Created
May 12, 2015 12:00
-
-
Save le0pard/db4700a041eedb98e83c to your computer and use it in GitHub Desktop.
lovefield + browserify
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git samples/calculator/calculator.html samples/calculator/calculator.html | |
| index 7f80d0c..acfd40b 100644 | |
| --- samples/calculator/calculator.html | |
| +++ samples/calculator/calculator.html | |
| @@ -2,11 +2,7 @@ | |
| <head> | |
| <title>Calculator</title> | |
| <link rel="stylesheet" type="text/css" href="style.css" /> | |
| - <script src="jquery/jquery.min.js"></script> | |
| - <script src="lovefield.js"></script> | |
| - <script src="controller.js"></script> | |
| - <script src="model.js"></script> | |
| - <script src="view.js"></script> | |
| + <script src="build.js"></script> | |
| </head> | |
| <body> | |
| @@ -47,7 +43,7 @@ | |
| <div class="calc-button minus big">–</div> | |
| <div class="calc-button plus big">+</div> | |
| <div class="calc-button equals big">=</div> | |
| - </div> | |
| + </div> | |
| </div> | |
| </div> | |
| </body> | |
| diff --git samples/calculator/controller.js samples/calculator/controller.js | |
| index cb4a228..39d582e 100644 | |
| --- samples/calculator/controller.js | |
| +++ samples/calculator/controller.js | |
| @@ -1,3 +1,9 @@ | |
| +var $ = require('./jquery/jquery.min.js'); | |
| +var lovefield = require('./lovefield.js'); | |
| +var lf = lovefield.lf; | |
| +var View = require('./view.js'); | |
| +var Calculator = require('./model.js'); | |
| + | |
| $(document).ready(function () { | |
| console.log('lf', lf); | |
| diff --git samples/calculator/model.js samples/calculator/model.js | |
| index b341c7b..407e236 100644 | |
| --- samples/calculator/model.js | |
| +++ samples/calculator/model.js | |
| @@ -127,3 +127,5 @@ Calculator.prototype.HandleButtonClick = function(buttonValue) { | |
| } | |
| return [this.operator, this.operand, this.accumulator]; | |
| } | |
| + | |
| +module.exports = Calculator; | |
| diff --git samples/calculator/view.js samples/calculator/view.js | |
| index 585d805..dbf4b05 100644 | |
| --- samples/calculator/view.js | |
| +++ samples/calculator/view.js | |
| @@ -193,3 +193,5 @@ View.prototype.UpdateDisplayEquation = function(operator, operand, accumulator) | |
| $(this.lastDisplayElement).children('.accumulator').text(accumulator); | |
| this.displayElement.scrollTop(this.displayElement[0].scrollHeight); | |
| } | |
| + | |
| +module.exports = View; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment