Node.js based forum software built for the modern web
Use .js instead of .jst
Peter Jaszkowiakdc87d7fc0f86
diff --git a/public/src/ajaxify.js b/public/src/ajaxify.jsindex c655cdca96..c18922485b 100644--- a/public/src/ajaxify.js+++ b/public/src/ajaxify.js@@ -330,7 +330,7 @@ $(document).ready(function () {};ajaxify.loadTemplate = function (template, callback) {- require([config.relative_path + '/assets/templates/' + template + '.jst'], callback, function (err) {+ require([config.relative_path + '/assets/templates/' + template + '.js'], callback, function (err) {console.error('Unable to load template: ' + template);throw err;});diff --git a/src/admin/search.js b/src/admin/search.jsindex dfc9034658..1803f3298c 100644--- a/src/admin/search.js+++ b/src/admin/search.js@@ -14,11 +14,11 @@ function filterDirectories(directories) {// get the relative pathreturn dir.replace(/^.*(admin.*?).tpl$/, '$1');}).filter(function (dir) {- // exclude .jst files+ // exclude .js files// exclude partials// only include subpaths// exclude category.tpl, group.tpl, category-analytics.tpl- return !dir.endsWith('.jst') &&+ return !dir.endsWith('.js') &&!dir.includes('/partials/') &&/\/.*\//.test(dir) &&!/manage\/(category|group|category-analytics)$/.test(dir);diff --git a/src/controllers/admin/settings.js b/src/controllers/admin/settings.jsindex 0410d4ea9e..28322892f3 100644--- a/src/controllers/admin/settings.js+++ b/src/controllers/admin/settings.js@@ -35,9 +35,9 @@ function renderEmail(req, res, next) {file.walk(emailsPath, next);},function (emails, next) {- // exclude .jst files+ // exclude .js filesemails = emails.filter(function (email) {- return !email.endsWith('.jst');+ return !email.endsWith('.js');});async.map(emails, function (email, next) {diff --git a/src/meta/templates.js b/src/meta/templates.jsindex 18991fc149..4f9f59d861 100644--- a/src/meta/templates.js+++ b/src/meta/templates.js@@ -76,7 +76,7 @@ Templates.compile = function (callback) {}, next);},function (next) {- rimraf(path.join(viewsPath, '*.jst'), next);+ rimraf(path.join(viewsPath, '*.js'), next);},function (next) {winston.verbose('[meta/templates] Successfully compiled templates.');diff --git a/src/middleware/index.js b/src/middleware/index.jsindex 511ae1ddd4..507878dc0c 100644--- a/src/middleware/index.js+++ b/src/middleware/index.js@@ -192,7 +192,7 @@ middleware.delayLoading = function (req, res, next) {var viewsDir = nconf.get('views_dir');middleware.templatesOnDemand = function (req, res, next) {var filePath = req.filePath || path.join(viewsDir, req.path);- if (!filePath.endsWith('.jst')) {+ if (!filePath.endsWith('.js')) {return next();}@@ -205,7 +205,7 @@ middleware.templatesOnDemand = function (req, res, next) {return next();}- fs.readFile(filePath.replace(/\.jst$/, '.tpl'), cb);+ fs.readFile(filePath.replace(/\.js$/, '.tpl'), cb);},function (source, cb) {Benchpress.precompile({diff --git a/src/views/500-embed.tpl b/src/views/500-embed.tplindex b1045d431f..f5258cb8db 100644--- a/src/views/500-embed.tpl+++ b/src/views/500-embed.tpl@@ -1,5 +1,5 @@<script>-define('/assets/templates/500.jst', function () {+define('/assets/templates/500.js', function () {function compiled(helpers, context, get, iter, helper) {return '<div class="alert alert-danger">\n\t<strong>[[global:500.title]]</strong>\n\t<p>[[global:500.message]]</p>\n\t<p>' +helpers.__escape(get(context && context['path'])) + '</p>\n\t' +diff --git a/src/webserver.js b/src/webserver.jsindex 26f4820c15..2918ea12f7 100644--- a/src/webserver.js+++ b/src/webserver.js@@ -122,7 +122,7 @@ function setupExpressApp(app, callback) {var viewsDir = nconf.get('views_dir');app.engine('tpl', function (filepath, data, next) {- filepath = filepath.replace(/\.tpl$/, '.jst');+ filepath = filepath.replace(/\.tpl$/, '.js');middleware.templatesOnDemand({filePath: filepath,diff --git a/test/search-admin.js b/test/search-admin.jsindex bb0fc6ecdc..f885b2bbf9 100644--- a/test/search-admin.js+++ b/test/search-admin.js@@ -14,10 +14,10 @@ describe('admin search', function () {]);done();});- it('should exclude .jst files', function (done) {+ it('should exclude .js files', function (done) {assert.deepEqual(search.filterDirectories(['hfjksfd/fdsgagag/admin/gdhgfsdg/sggag.tpl',- 'dfahdfsgf/admin/hgkfds/fdhsdfh.jst',+ 'dfahdfsgf/admin/hgkfds/fdhsdfh.js',]), ['admin/gdhgfsdg/sggag',]);