mirror of
				https://github.com/NodeBB/NodeBB.git
				synced 2025-10-31 11:05:54 +01:00 
			
		
		
		
	removing backwards compatibility fixed in preparation for 0.5.0. Prepare for stuff to break!!!!!
This commit is contained in:
		| @@ -259,7 +259,6 @@ var fs = require('fs'), | ||||
| 					jsPaths = scripts.map(function (jsPath) { | ||||
| 						jsPath = path.normalize(jsPath); | ||||
|  | ||||
| 						// The filter:scripts.get plugin will be deprecated as of v0.5.0, specify scripts in plugin.json instead | ||||
| 						if (jsPath.substring(0, 7) === 'plugins') { | ||||
| 							var	matches = _.map(plugins.staticDirs, function(realPath, mappedPath) { | ||||
| 								if (jsPath.match(mappedPath)) { | ||||
| @@ -283,7 +282,6 @@ var fs = require('fs'), | ||||
| 						} | ||||
| 					}); | ||||
|  | ||||
| 				// Remove scripts that could not be found (remove this line at v0.5.0) | ||||
| 				Meta.js.scripts = jsPaths.filter(function(path) { | ||||
| 					return path !== null; | ||||
| 				}); | ||||
|   | ||||
| @@ -61,17 +61,6 @@ function routeCurrentTheme(app, themeId, themesData) { | ||||
| 	// Theme's templates path | ||||
| 	nconf.set('theme_templates_path', themeObj.templates ? path.join(themesPath, themeObj.id, themeObj.templates) : nconf.get('base_templates_path')); | ||||
| 	themeTemplatesPath = nconf.get('theme_templates_path'); | ||||
|  | ||||
| 	// Theme's static directory (to be deprecated for 0.5.0) | ||||
| 	if (themeObj.staticDir) { | ||||
| 		app.use(relativePath + '/css/assets', express.static(path.join(themesPath, themeObj.id, themeObj.staticDir), { | ||||
| 			maxAge: app.enabled('cache') ? 5184000000 : 0 | ||||
| 		})); | ||||
|  | ||||
| 		if (process.env.NODE_ENV === 'development') { | ||||
| 			winston.info('Static directory routed for theme: ' + themeObj.id); | ||||
| 		} | ||||
| 	} | ||||
| } | ||||
|  | ||||
| function compileTemplates(pluginTemplates) { | ||||
|   | ||||
| @@ -195,18 +195,8 @@ var fs = require('fs'), | ||||
| 						} | ||||
|  | ||||
| 						Plugins.cssFiles = Plugins.cssFiles.concat(pluginData.css.map(function(file) { | ||||
| 							if (fs.existsSync(path.join(__dirname, '../node_modules', pluginData.id, file))) { | ||||
| 								return path.join(pluginData.id, file); | ||||
| 							} else { | ||||
| 								// Backwards compatibility with < v0.4.0, remove this for v0.5.0 | ||||
| 								if (pluginData.staticDir) { | ||||
| 									return path.join(pluginData.id, pluginData.staticDir, file); | ||||
| 								} else { | ||||
| 									winston.error('[plugins/' + pluginData.id + '] This plugin\'s CSS is incorrectly configured, please contact the plugin author.'); | ||||
| 									return null; | ||||
| 								} | ||||
| 							} | ||||
| 						}).filter(function(path) { return path }));	// Filter out nulls, remove this for v0.5.0 | ||||
| 							return path.join(pluginData.id, file); | ||||
| 						})); | ||||
| 					} | ||||
|  | ||||
| 					next(); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user