Permalink
Browse files

merge

  • Loading branch information...
mhevery committed Mar 20, 2011
2 parents 47a7f96 + 82dd423 commit 824503b9441737bde666ea5514418773cc668f60
Showing with 9,259 additions and 7,237 deletions.
  1. 0 app/css/.gitignore
  2. +1 −1 public/style.css → app/css/app.css
  3. 0 app/img/.gitignore
  4. +8 −5 public/calculator.html → app/index.html
  5. +9 −8 public/calculator.js → app/js/controllers.js
  6. +1 −0 app/js/filters.js
  7. +2 −0 app/js/services.js
  8. +1 −0 app/js/widgets.js
  9. 0 public/angular/angular-ie-compat-0.9.5.js → app/lib/angular/angular-ie-compat.js
  10. +4,236 −3,459 public/angular/angular-0.9.5.js → app/lib/angular/angular.js
  11. +113 −0 app/lib/angular/angular.min.js
  12. +2 −0 app/lib/angular/version.txt
  13. 0 app/partials/.gitignore
  14. +12 −0 config/jsTestDriver.conf
  15. +0 −8 jsTestDriver.conf
  16. +0 −111 lib/jasmine-jstd-adapter/JasmineAdapter.js
  17. BIN lib/jstestdriver/coverage.jar
  18. +2 −0 logs/.gitignore
  19. +0 −106 public/angular/angular-0.9.5.min.js
  20. +0 −10 scenario/Runner.html
  21. +10 −0 scripts/test-server.sh
  22. +10 −0 scripts/test.sh
  23. +19 −0 scripts/watchr.rb
  24. +243 −0 scripts/web-server.js
  25. +0 −1 server.sh
  26. +0 −8 test.sh
  27. +10 −0 test/e2e/runner.html
  28. +5 −5 scenario/calculatorScenario.js → test/e2e/scenarios.js
  29. +122 −25 public/angular/angular-mocks-0.9.5.js → test/lib/angular/angular-mocks.js
  30. +4,259 −3,476 public/angular/angular-scenario-0.9.5.js → test/lib/angular/angular-scenario.js
  31. +2 −0 test/lib/angular/version.txt
  32. +179 −0 test/lib/jasmine-jstd-adapter/JasmineAdapter.js
  33. +1 −0 test/lib/jasmine-jstd-adapter/version.txt
  34. 0 {lib/jasmine-1.0.1 → test/lib/jasmine}/MIT.LICENSE
  35. 0 {lib/jasmine-1.0.1 → test/lib/jasmine}/index.js
  36. 0 {lib/jasmine-1.0.1 → test/lib/jasmine}/jasmine-html.js
  37. 0 {lib/jasmine-1.0.1 → test/lib/jasmine}/jasmine.css
  38. 0 {lib/jasmine-1.0.1 → test/lib/jasmine}/jasmine.js
  39. +2 −0 test/lib/jasmine/version.txt
  40. BIN { → test}/lib/jstestdriver/JsTestDriver.jar
  41. +1 −0 test/lib/jstestdriver/version.txt
  42. +6 −6 specs/calculatorSpec.js → test/unit/controllersSpec.js
  43. +1 −0 test/unit/filtersSpec.js
  44. +1 −0 test/unit/servicesSpec.js
  45. +1 −0 test/unit/widgetsSpec.js
  46. +0 −8 webserver.js
View
No changes.
@@ -28,4 +28,4 @@
#keys button.wide {
width:88px;
margin:2px;
-}
+}
View
No changes.
@@ -2,13 +2,16 @@
<html xmlns:ng="http://angularjs.org">
<head>
<title>Calculator</title>
- <script type="text/javascript" src="angular/angular-0.9.5.js" ng:autobind></script>
- <script type="text/javascript" src="calculator.js"></script>
- <link type="text/css" rel="stylesheet" href="style.css"/>
+ <script type="text/javascript" src="lib/angular/angular.js" ng:autobind></script>
+ <script type="text/javascript" src="js/controllers.js"></script>
+ <script type="text/javascript" src="js/filters.js"></script>
+ <script type="text/javascript" src="js/services.js"></script>
+ <script type="text/javascript" src="js/widgets.js"></script>
+ <link type="text/css" rel="stylesheet" href="css/app.css"/>
</head>
<body>
<div id="calculator" ng:controller="CalculatorController">
- <div id="display"/>{{display()}}</div>
+ <div id="display">{{display}}</div>
<div id="keys">
<button ng:click="number('7')">7</button>
<button ng:click="number('8')">8</button>
@@ -31,4 +34,4 @@
</div>
</div>
</body>
-</html>
+</html>
@@ -5,18 +5,18 @@ function CalculatorController(){
CalculatorController.prototype = {
clear: function(){
this.value = 0;
+ this.display = "0.";
this.decimalPosition = null;
},
- display: function(){
- var text = this.value.toString();
- if (!text.match(/\./)) {
- text += '.';
+ updateDisplay: function(){
+ this.display = this.value.toString();
+ if (!this.display.match(/\./)) {
+ this.display += '.';
}
- while(text.match(/\.(.*)/)[1].length + 1 < this.decimalPosition) {
- text += '0';
+ while(this.display.match(/\.(.*)/)[1].length + 1 < this.decimalPosition) {
+ this.display += '0';
}
- return text;
},
key: function(key) {
@@ -30,11 +30,12 @@ CalculatorController.prototype = {
number: function(number){
number = parseInt(number, 10);
if (this.decimalPosition) {
- this.value = parseFloat(this.display() + number);
+ this.value = parseFloat(this.display + number);
this.decimalPosition++;
} else {
this.value = this.value * 10 + number;
}
+ this.updateDisplay();
}
};
View
@@ -0,0 +1 @@
+/* http://docs.angularjs.org/#!angular.filter */
View
@@ -0,0 +1,2 @@
+/* http://docs.angularjs.org/#!angular.service */
+
View
@@ -0,0 +1 @@
+/* http://docs.angularjs.org/#!angular.widget */
Oops, something went wrong.

0 comments on commit 824503b

Please sign in to comment.