Skip to content

Commit

Permalink
move all code into safer IIFE
Browse files Browse the repository at this point in the history
  • Loading branch information
danprince committed Aug 25, 2015
1 parent 52a94a9 commit 2a2f30a
Showing 1 changed file with 26 additions and 25 deletions.
51 changes: 26 additions & 25 deletions js/colors.js
Original file line number Diff line number Diff line change
@@ -1,26 +1,27 @@
var colors = {
aqua: "#7FDBFF",
blue: "#0074D9",
lime: "#01FF70",
navy: "#001F3F",
teal: "#39CCCC",
olive: "#3D9970",
green: "#2ECC40",
red: "#FF4136",
maroon: "#85144B",
orange: "#FF851B",
purple: "#B10DC9",
yellow: "#FFDC00",
fuchsia: "#F012BE",
gray: "#aaa",
white: "#fff",
black: "#111",
silver: "#ddd"
};
(function() {
var colors = {
aqua: "#7FDBFF",
blue: "#0074D9",
lime: "#01FF70",
navy: "#001F3F",
teal: "#39CCCC",
olive: "#3D9970",
green: "#2ECC40",
red: "#FF4136",
maroon: "#85144B",
orange: "#FF851B",
purple: "#B10DC9",
yellow: "#FFDC00",
fuchsia: "#F012BE",
gray: "#aaa",
white: "#fff",
black: "#111",
silver: "#ddd"
};

if(
typeof module !== "undefined" &&
typeof module.exports !== "undefined"
){
module.exports = colors;
}
if(typeof module !== "undefined" && typeof module.exports !== "undefined") {
module.exports = colors;
} else {
window.colors = colors;
}
})();

0 comments on commit 2a2f30a

Please sign in to comment.