This repository has been archived by the owner on Dec 20, 2017. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
153 additions
and
56 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
.DS_Store | ||
node_modules | ||
/node_modules/ | ||
.coverage_data |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
module.exports = function(variableName, source, returns) { | ||
if (!returns) returns = 'exports'; | ||
var start = 'var '+variableName+' = (function(exports, module) {\n'; | ||
var end = '\nreturn '+returns+';\n})({}, true);'; | ||
var start = 'var '+variableName+' = (function(exports) {\n'; | ||
var end = '\nreturn '+returns+';\n})({});'; | ||
return start + source + end; | ||
}; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
all: | ||
@../../../bin/clientside > dist/awesomecalc.js |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
var AwesomeCalc = (function(exports) { | ||
var cs1 = (function(exports) { | ||
|
||
exports.add = function(num1, num2) { | ||
return num1 + num2; | ||
} | ||
|
||
return exports; | ||
})({}); | ||
/*! | ||
* aug.js - A javascript library to extend existing objects and prototypes | ||
* v0.0.1 | ||
* https://github.com/jgallen23/aug | ||
* copyright JGA 2011 | ||
* MIT License | ||
*/ | ||
|
||
!function (name, definition) { | ||
if (typeof module != 'undefined' && module.exports) module.exports = definition(); | ||
else if (typeof define == 'function' && typeof define.amd == 'object') define(definition); | ||
else this[name] = definition(); | ||
}('aug', function() { | ||
|
||
var aug = function __aug() { | ||
var args = Array.prototype.slice.call(arguments); | ||
var org = args.shift(); | ||
for (var i = 0, c = args.length; i < c; i++) { | ||
var prop = args[i]; | ||
for (var name in prop) { | ||
org[name] = prop[name]; | ||
} | ||
} | ||
return org; | ||
}; | ||
|
||
return aug; | ||
}); | ||
|
||
var cs0 = (function(exports) { | ||
var calc = cs1; | ||
var aug = window.aug; | ||
|
||
var Calculator = function(options) { | ||
var defaults = { | ||
debug: false | ||
} | ||
this.options = aug({}, defaults, options); | ||
} | ||
|
||
Calculator.prototype.add = function(num1, num2) { | ||
return calc.add(num1, num2); | ||
} | ||
|
||
exports = Calculator; | ||
|
||
return exports; | ||
})({}); | ||
return cs0; | ||
})({}); |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
var calc = require('calc'); | ||
var aug = require('aug'); | ||
|
||
var Calculator = function(options) { | ||
var defaults = { | ||
debug: false | ||
} | ||
this.options = aug({}, defaults, options); | ||
} | ||
|
||
Calculator.prototype.add = function(num1, num2) { | ||
return calc.add(num1, num2); | ||
} | ||
|
||
module.exports = Calculator; |
File renamed without changes.
File renamed without changes.
Empty file.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"name": "awesomeCalc", | ||
"clientside": { | ||
"name": "AwesomeCalc", | ||
"settings": { | ||
"aug": { | ||
"modify": false, | ||
"id": "window.aug" | ||
} | ||
} | ||
} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<html> | ||
<head> | ||
<title></title> | ||
<script src="../dist/awesomecalc.js"></script> | ||
<script> | ||
var calc = new AwesomeCalc(); | ||
console.log(calc.add(1, 2)); | ||
</script> | ||
</head> | ||
<body> | ||
</body> | ||
</html> |