;(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o"); calc_div = this.element.find("div." + calculator_wrapper_class); calc_div.append("
0
"); return this.layout.render(calc_div); }; return CalculatorView; })(); class_mixer(CalculatorView); ttm.widgets.Calculator = Calculator; }).call(this); },{}],3:[function(require,module,exports){ (function() { var ButtonBuilder, ttm; ttm = thinkthroughmath; ButtonBuilder = (function() { function ButtonBuilder() {} ButtonBuilder.prototype.initialize = function(opts) { this.opts = opts != null ? opts : {}; return this.ui_elements = this.opts.ui_elements; }; ButtonBuilder.prototype.base10Digits = function(opts) { var num, _i, _results, _this = this; if (opts == null) { opts = {}; } _results = []; for (num = _i = 0; _i <= 9; num = ++_i) { _results.push((function(num) { return _this.button({ value: "" + num, "class": "jc--button jc--button-number", ariaLabel: "" + num }, opts); })(num)); } return _results; }; ButtonBuilder.prototype.decimal = function(opts) { return this.button({ value: ".", "class": "jc--button jc--button-decimal", ariaLabel: "Decimal Separator" }, opts); }; ButtonBuilder.prototype.negative = function(opts) { return this.button({ value: "negative", label: "(–)", "class": "jc--button jc--button-negative", ariaLabel: "Negative" }, opts); }; ButtonBuilder.prototype.addition = function(opts) { return this.button({ value: "+", "class": "jc--button jc--button-operation jc--button-add", ariaLabel: "Plus" }, opts); }; ButtonBuilder.prototype.subtraction = function(opts) { return this.button({ value: "-", label: "−", "class": "jc--button jc--button-operation jc--button-subtract", ariaLabel: "Minus" }, opts); }; ButtonBuilder.prototype.multiplication = function(opts) { return this.button({ value: "*", label: "×", "class": "jc--button jc--button-operation jc--button-multiply", ariaLabel: "Multiply by" }, opts); }; ButtonBuilder.prototype.division = function(opts) { return this.button({ value: "/", label: "÷", "class": "jc--button jc--button-operation jc--button-divide", ariaLabel: "Divide by" }, opts); }; ButtonBuilder.prototype.equals = function(opts) { return this.button({ value: "=", "class": "jc--button jc--button-operation jc--button-equal", ariaLabel: "Equals" }, opts); }; ButtonBuilder.prototype.lparen = function(opts) { return this.button({ value: "(", "class": "jc--button jc--button-other jc--button-rParen", ariaLabel: "Left parenthesis" }, opts); }; ButtonBuilder.prototype.rparen = function(opts) { return this.button({ value: ")", "class": "jc--button jc--button-other jc--button-lParen", ariaLabel: "Right parenthesis" }, opts); }; ButtonBuilder.prototype.pi = function(opts) { return this.button({ value: "pi", label: "π", "class": "jc--button jc--button-other jc--button-pi", ariaLabel: "Pi" }, opts); }; ButtonBuilder.prototype.fraction = function(opts) { return this.button({ value: "fraction", label: "a/b", "class": "jc--button jc--button-other jc--button-fraction" }, opts); }; ButtonBuilder.prototype.caret = function(opts) { return this.button({ value: "^", "class": "jc--button jc--button-other jc--button-caret", ariaLabel: "Caret" }, opts); }; ButtonBuilder.prototype.exponent = function(opts) { var base, power; base = opts.base || "x"; power = opts.power || "y"; return this.button({ value: "exponent", label: "" + base + "" + power + "", "class": "jc--button jc--button-other jc--button-exponent jc--button-exponent-" + base + "to" + power, ariaLabel: "Square" }, opts); }; ButtonBuilder.prototype.root = function(opts) { var degree, radicand; degree = opts.degree ? "" + opts.degree : ""; radicand = opts.radicand || "x"; return this.button({ value: "root", label: degree ? "" + degree + "√" + radicand : "√" + radicand, "class": "jc--button jc--button-other jc--button-root jc--button-root-" + degree + "of" + radicand, ariaLabel: "Square root" }, opts); }; ButtonBuilder.prototype.variables = function(opts) { var v, variables; variables = (function() { var _i, _len, _ref, _results, _this = this; _ref = opts.variables; _results = []; for (_i = 0, _len = _ref.length; _i < _len; _i++) { v = _ref[_i]; _results.push((function(v) { return _this.button({ value: "" + v.name, "class": "jc--button jc--button-variable", variable: v }, opts); })(v)); } return _results; }).call(this); return variables; }; ButtonBuilder.prototype.del = function(opts) { return this.button({ value: "del", label: "Delete", "class": "jc--button jc--button-del" }, opts); }; ButtonBuilder.prototype.clear = function(opts) { return this.button({ value: "clear", label: "Clear", "class": "jc--button jc--button-clear", ariaLabel: "Clear" }, opts); }; ButtonBuilder.prototype.button = function(type_opts, opts) { return this.ui_elements.button_builder.build(_.extend({}, type_opts, this.opts, opts || {})); }; return ButtonBuilder; })(); ttm.widgets.ButtonBuilder = ttm.class_mixer(ButtonBuilder); }).call(this); },{}],4:[function(require,module,exports){ (function() { var Button, MathDisplay, UIElements, ttm; ttm = thinkthroughmath; Button = (function() { function Button() {} Button.prototype.initialize = function(opts) { this.opts = opts != null ? opts : {}; }; Button.prototype.render = function(opts) { var button; if (opts == null) { opts = {}; } opts = _.extend({}, this.opts, opts); button = $(""); button.on("click", function() { return opts.click && opts.click(opts); }); return opts.element.append(button); }; return Button; })(); ttm.class_mixer(Button); MathDisplay = (function() { function MathDisplay() {} MathDisplay.prototype.initialize = function(opts) { this.opts = opts != null ? opts : {}; }; MathDisplay.prototype.render = function(opts) { if (opts == null) { opts = {}; } opts = _.extend({}, this.opts, opts); this.figure = $("
" + (opts["default"] || '0') + "
"); opts.element.append(this.figure); return this.figure; }; MathDisplay.prototype.update = function(value) { return this.figure.html(value); }; return MathDisplay; })(); ttm.class_mixer(MathDisplay); UIElements = (function() { function UIElements() {} UIElements.prototype.button_builder = Button; UIElements.prototype.math_display_builder = MathDisplay; return UIElements; })(); ttm.widgets.UIElements = ttm.class_mixer(UIElements); }).call(this); },{}]},{},[1,2,3,4]) ;