From 8bf481f27baf99a1f6bed24c84f47080c33a8e15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Bartelme=C3=9F?= Date: Sat, 24 Mar 2012 13:28:17 +0100 Subject: [PATCH 1/2] Send the Content-Type header for plugin-definitions.json in the right format --- src/node/hooks/express/static.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/node/hooks/express/static.js b/src/node/hooks/express/static.js index e8f9afbb8..9209967ce 100644 --- a/src/node/hooks/express/static.js +++ b/src/node/hooks/express/static.js @@ -35,7 +35,7 @@ exports.expressCreateServer = function (hook_name, args, cb) { // serve plugin definitions // not very static, but served here so that client can do require("pluginfw/static/js/plugin-definitions.js"); args.app.get('/pluginfw/plugin-definitions.json', function (req, res, next) { - res.header("Content-Type","application/json; charset: utf-8"); + res.header("Content-Type","application/json; charset=utf-8"); res.write(JSON.stringify({"plugins": plugins.plugins, "parts": plugins.parts})); res.end(); }); From 208d88cc036c6c2dda4f1746f7b17adbaec1a1a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Bartelme=C3=9F?= Date: Sat, 24 Mar 2012 13:29:15 +0100 Subject: [PATCH 2/2] proceed if plugin-definitions.json didn't load properly --- src/static/js/pluginfw/plugins.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/static/js/pluginfw/plugins.js b/src/static/js/pluginfw/plugins.js index c5c219032..1f3acab35 100644 --- a/src/static/js/pluginfw/plugins.js +++ b/src/static/js/pluginfw/plugins.js @@ -78,6 +78,9 @@ if (exports.isClient) { exports.hooks = exports.extractHooks(exports.parts, "client_hooks"); exports.loaded = true; cb(); + }).error(function(xhr, s, err){ + console.error("Failed to load plugin-definitions: " + err); + cb(); }); } } else {