From 2b5a1ce6d47ab41ab7680ecb481277fea48c79e9 Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Tue, 11 Nov 2014 10:16:01 +0000 Subject: [PATCH] Add settings changes --- public/red/settings.js | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/public/red/settings.js b/public/red/settings.js index 7deee90a5..b156adfdd 100644 --- a/public/red/settings.js +++ b/public/red/settings.js @@ -1,5 +1,5 @@ /** - * Copyright 2014 Antoine Aflalo + * Copyright 2014 IBM, Antoine Aflalo * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -58,7 +58,7 @@ RED.settings = (function () { } }; - var init = function (callback) { + var init = function (then,otherwise) { $.ajax({ headers: { "Accept": "application/json" @@ -69,17 +69,21 @@ RED.settings = (function () { success: function (data) { setProperties(data); console.log("Node-RED: " + data.version); - callback(); + console.log(data); + then(); + }, + error: function(jqXHR,textStatus,errorThrown) { + otherwise(jqXHR.status,textStatus); } }); }; return { + init: init, set: set, get: get, - remove: remove, - init : init + remove: remove } }) -(); \ No newline at end of file +();