Skip to content

Commit

Permalink
Updates config
Browse files Browse the repository at this point in the history
  • Loading branch information
acadet committed Feb 7, 2014
1 parent 840f6b6 commit 07a6fe9
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 14 deletions.
12 changes: 6 additions & 6 deletions coffee/boot.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@ require(
baseUrl: @folder

# Enable/Disable caching
if not CROQUE_CONFIG.cache
if not CROQUECONFIG.cache
@requireConfig.urlArgs = "bust=" + (new Date()).getTime()

# Gathering libs
for key, value of CROQUE_CONFIG.libs
for key, value of CROQUECONFIG.libs
# Disable specified libs for IE
if key in CROQUE_CONFIG.IESupport
if key in CROQUECONFIG.IESupport
if /MSIE (\d+\.\d+);/.test(navigator.userAgent)
define key, []
else
Expand All @@ -61,14 +61,14 @@ require(
@requireConfig.paths[key] = value

# Setting exports
for key, value of CROQUE_CONFIG.exports
for key, value of CROQUECONFIG.exports
if not @requireConfig.shim
@requireConfig.shim = {}
@requireConfig.shim[key] =
exports: value

# Adding extras if they exist
for key, value of CROQUE_CONFIG.extras
for key, value of CROQUECONFIG.extras
@requireConfig[key] = value

require.config(
Expand All @@ -77,7 +77,7 @@ require(

# Launch main class' requirement
require(
CROQUE_CONFIG.default
CROQUECONFIG.default
() =>
require(
[@classPath]
Expand Down
2 changes: 1 addition & 1 deletion coffee/config.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# @brief This file wraps config of CM. More details on official website
###

CROQUE_CONFIG =
CROQUECONFIG =
###
# You can disable cache when developing
###
Expand Down
4 changes: 4 additions & 0 deletions coffee/system/Utils.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ miam(

obj1

###
# Capitalizes first letter of string
# @param string
###
@capitalize: (string) ->
if string.length < 1
throw new Error 'Unable to capitalize: string is too short'
Expand Down
12 changes: 6 additions & 6 deletions js/boot.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@
this.requireConfig = {
baseUrl: this.folder
};
if (!CROQUE_CONFIG.cache) {
if (!CROQUECONFIG.cache) {
this.requireConfig.urlArgs = "bust=" + (new Date()).getTime();
}
_ref = CROQUE_CONFIG.libs;
_ref = CROQUECONFIG.libs;
for (key in _ref) {
value = _ref[key];
if (__indexOf.call(CROQUE_CONFIG.IESupport, key) >= 0) {
if (__indexOf.call(CROQUECONFIG.IESupport, key) >= 0) {
if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)) {
define(key, []);
} else {
Expand All @@ -60,7 +60,7 @@
this.requireConfig.paths[key] = value;
}
}
_ref1 = CROQUE_CONFIG.exports;
_ref1 = CROQUECONFIG.exports;
for (key in _ref1) {
value = _ref1[key];
if (!this.requireConfig.shim) {
Expand All @@ -70,13 +70,13 @@
exports: value
};
}
_ref2 = CROQUE_CONFIG.extras;
_ref2 = CROQUECONFIG.extras;
for (key in _ref2) {
value = _ref2[key];
this.requireConfig[key] = value;
}
require.config(this.requireConfig);
require(CROQUE_CONFIG["default"], function() {
require(CROQUECONFIG["default"], function() {
return require([_this.classPath], function() {
return _this.whenReady(function() {
var browser, e;
Expand Down
2 changes: 1 addition & 1 deletion js/config.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 07a6fe9

Please sign in to comment.