Skip to content

Commit

Permalink
Merge pull request #151 from aismail/f/#146-create-USE_BRANDING-flag
Browse files Browse the repository at this point in the history
Created USE_BRANDING and EXTRA_BRANDING (#146)
  • Loading branch information
Andrei-Adnan Ismail committed May 17, 2013
2 parents 8f35ded + d9b3739 commit 1914fb2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
5 changes: 4 additions & 1 deletion app/conf/general.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ App.general = {
SVG_PATH: '/public/svg',
ENVIRONMENT: 'testing',

//CSS files used for branding purposes
EXTRA_BRANDING: [],

// Throw exceptions and don't catch them with our wrapper
// so that we can debug them easier.
THROW_UNCAUGHT_EXCEPTIONS: true,
Expand Down Expand Up @@ -52,4 +55,4 @@ if (App.general.ENVIRONMENT !== 'production')

if (typeof module != 'undefined') {
module.exports.general = App.general;
}
}
14 changes: 9 additions & 5 deletions app/includes.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ function getStaticUrl() {

function includeCssAndJs() {
includeStaticFilesInBundles();
includeBranding();
if (App.general.EXTRA_BRANDING.length){
includeBranding(App.general.EXTRA_BRANDING);
}
includeMainEntryPoint();
includeTemplates();
}
Expand Down Expand Up @@ -102,9 +104,11 @@ function includeStaticFilesInBundles_Development() {
* Also, we cannot use includeCss because we need it to have an ID
* (#custom-css).
*/
function includeBranding() {
document.write("<link rel='stylesheet' id='custom-css' " +
"href='/assets/custom.css'/>");
function includeBranding(files) {
for(var i=0; i < files.length;i++) {
document.write("<link rel='stylesheet' id='custom-css' " +
"href= '" + files[i] + "'/>");
}
}

/*
Expand Down Expand Up @@ -180,4 +184,4 @@ function replaceReferencesFromConfigVariables() {

overrideGeneralConfigWithUserConfig();
replaceReferencesFromConfigVariables();
includeCssAndJs();
includeCssAndJs();

0 comments on commit 1914fb2

Please sign in to comment.