-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3979 from pangratz/feature_flags
Re-enable feature flags
- Loading branch information
Showing
8 changed files
with
71 additions
and
14 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
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,5 @@ | ||
import Ember from 'ember'; | ||
|
||
export default function isEnabled() { | ||
return Ember.FEATURES.isEnabled(...arguments); | ||
} |
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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/*jshint node:true*/ | ||
module.exports = { | ||
name: 'enable-optional-features-via-url', | ||
|
||
/** | ||
So the ENABLE_OPTIONAL_FEATURES flag is considered correctly within the | ||
index.html, it needs to be set before Ember.js is loaded. Since there is | ||
currently no way to access the `window` object within config/environment.js | ||
(and hereby check if there is a query parameter present for the checkbox), | ||
a script is injected, before Ember.js is loaded. The script checks if there | ||
is no value yet for the ENABLE_OPTIONAL_FEATURES flag, and if so, it sets | ||
the flag to true when there is a `enableoptionalfeatures` query parameter. | ||
*/ | ||
contentFor: function(name) { | ||
if (name === "vendor-prefix") { | ||
var array = [ | ||
"<!-- injected by lib/enable-optional-features-via-url -->", | ||
"window.EmberENV = window.EmberENV || {};", | ||
"if (typeof window.EmberENV.ENABLE_OPTIONAL_FEATURES === 'undefined') {", | ||
" window.EmberENV.ENABLE_OPTIONAL_FEATURES = window.location.search.indexOf('enableoptionalfeatures') !== -1;", | ||
"}" | ||
]; | ||
|
||
return array.join('\n'); | ||
} | ||
} | ||
}; |
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,6 @@ | ||
{ | ||
"name": "enable-optional-features-via-url", | ||
"keywords": [ | ||
"ember-addon" | ||
] | ||
} |
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