From 51038d656cf4374d4e24ed0c01589c28babf65e3 Mon Sep 17 00:00:00 2001 From: "kay.one" Date: Sat, 30 Mar 2013 12:13:10 -0700 Subject: [PATCH] template names are now case in-sensitive. --- Gruntfile.js | 3 ++- UI/Mixins/backbone.marionette.templates.js | 13 +++++++------ UI/Shared/NotFoundTemplate.html | 2 +- update.js | 1 + 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index cc86db1e6..a088e05e4 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -25,7 +25,8 @@ module.exports = function(grunt) { processName: function(fileName){ return fileName .replace('UI/','') - .replace('.html',''); + .replace('.html','') + .toLowerCase(); } }, files: { diff --git a/UI/Mixins/backbone.marionette.templates.js b/UI/Mixins/backbone.marionette.templates.js index ea57e18e3..c3cdeffd8 100644 --- a/UI/Mixins/backbone.marionette.templates.js +++ b/UI/Mixins/backbone.marionette.templates.js @@ -1,22 +1,23 @@ "use strict"; Marionette.TemplateCache.get = function (templateId) { - var templateFunction = window.Templates[templateId]; + + var templateKey = templateId.toLowerCase(); + + var templateFunction = window.Templates[templateKey.toLowerCase()]; if (!templateFunction) { - console.error('couldn\'t find pre-compiled template ' + templateId); + throw 'couldn\'t find pre-compiled template ' + templateKey; } - var templateName = templateId; - return function (data) { try { - //console.log('rendering template ' + templateName); + //console.log('rendering template ' + templateKey); return templateFunction(data); } catch (error) { - console.error('template render failed for ' + templateName + ' ' + error.message); + console.error('template render failed for ' + templateKey + ' ' + error.message); console.error(data); } }; diff --git a/UI/Shared/NotFoundTemplate.html b/UI/Shared/NotFoundTemplate.html index e2cfb53e7..3b4272fca 100644 --- a/UI/Shared/NotFoundTemplate.html +++ b/UI/Shared/NotFoundTemplate.html @@ -1,3 +1,3 @@ 
- +
diff --git a/update.js b/update.js index e4c007799..22f56516e 100644 --- a/update.js +++ b/update.js @@ -9,6 +9,7 @@ module.exports = function(grunt) { 'NzbDrone.Backbone/JsLibraries/backbone.js': 'http://raw.github.com/documentcloud/backbone/master/backbone.js', 'NzbDrone.Backbone/JsLibraries/backbone.marionette.js': 'http://raw.github.com/marionettejs/backbone.marionette/master/lib/backbone.marionette.js', 'NzbDrone.Backbone/JsLibraries/backbone.mutators.js': 'http://raw.github.com/asciidisco/Backbone.Mutators/master/backbone.mutators.js', + 'NzbDrone.Backbone/JsLibraries/handlebars.runtime.js': 'http://raw.github.com/wycats/handlebars.js/master/dist/handlebars.runtime.js' } });