Put file deprecated into js directory

Request in Pull Request #569
Initial work by @olexs
This commit is contained in:
Rodrigo Ramírez Norambuena 2017-02-21 19:28:53 -03:00
parent fd7fe129e2
commit db0b663a3d
4 changed files with 13 additions and 8 deletions

View File

@ -47,6 +47,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
- Estonian Translation. - Estonian Translation.
- Add test for compliments module for parts of day - Add test for compliments module for parts of day
- Korean Translation. - Korean Translation.
- Added console warning on startup when deprecated config options are used
### Fixed ### Fixed
@ -92,7 +93,6 @@ This project adheres to [Semantic Versioning](http://semver.org/).
- Added ability to configure electronOptions - Added ability to configure electronOptions
- Calendar module: option to hide private events - Calendar module: option to hide private events
- Add root_path for global vars - Add root_path for global vars
- Added console warning on startup when deprecated config options are used
### Updated ### Updated
- Modified translations for Frysk. - Modified translations for Frysk.

1
config/.gitignore vendored
View File

@ -1,3 +1,2 @@
* *
!config.js.sample !config.js.sample
!deprecated.js

View File

@ -79,7 +79,7 @@ var App = function() {
}; };
var checkDeprecatedOptions = function(userConfig) { var checkDeprecatedOptions = function(userConfig) {
var deprecatedOptions = require(__dirname + "/../config/deprecated.js"); var deprecatedOptions = require(global.root_path + "/js/deprecated.js").configs;
var usedDeprecated = []; var usedDeprecated = [];
deprecatedOptions.forEach(function(option) { deprecatedOptions.forEach(function(option) {
@ -89,7 +89,11 @@ var App = function() {
}); });
if (usedDeprecated.length > 0) { if (usedDeprecated.length > 0) {
console.error("WARNING! Your config is using deprecated options: " + usedDeprecated.join(", ") + ". Check README and CHANGELOG for more up-to-date ways of getting the same functionality."); console.warn(
"WARNING! Your config is using deprecated options: ",
usedDeprecated.join(", "),
". Check README and CHANGELOG for more up-to-date ways of getting the same functionality."
);
} }
} }

View File

@ -2,11 +2,13 @@
* *
* By Michael Teeuw http://michaelteeuw.nl * By Michael Teeuw http://michaelteeuw.nl
* MIT Licensed. * MIT Licensed.
*
* Olex S. original idea this deprecated option
*/ */
var deprecated = [ var deprecated = {
'kioskmode' configs: ["kioskmode"]
]; };
/*************** DO NOT EDIT THE LINE BELOW ***************/ /*************** DO NOT EDIT THE LINE BELOW ***************/
if (typeof module !== 'undefined') {module.exports = deprecated;} if (typeof module !== "undefined") {module.exports = deprecated;}