From b234ff7acbaa1d4f465ad58dd816d9eae5cf6530 Mon Sep 17 00:00:00 2001 From: Torsten Dreyer Date: Fri, 6 Feb 2015 12:04:17 +0100 Subject: [PATCH] Phi: Help has more than just ... --- webgui/topics/Aircraft/Help.html | 19 ++++++++++++++---- webgui/topics/Aircraft/Help.js | 33 +++++++++++++++++++++++++++----- 2 files changed, 43 insertions(+), 9 deletions(-) diff --git a/webgui/topics/Aircraft/Help.html b/webgui/topics/Aircraft/Help.html index baf8e1fe5..314de7678 100644 --- a/webgui/topics/Aircraft/Help.html +++ b/webgui/topics/Aircraft/Help.html @@ -1,6 +1,17 @@ -

-
-
-
+ + + + + + + + + + + + + + +
diff --git a/webgui/topics/Aircraft/Help.js b/webgui/topics/Aircraft/Help.js index 777450a78..8692ec3e5 100644 --- a/webgui/topics/Aircraft/Help.js +++ b/webgui/topics/Aircraft/Help.js @@ -5,19 +5,42 @@ define([ var self = this; self.helpTitle = ko.observable(""); - self.helpText = ko.observableArray([]); + self.helpContent = ko.observableArray([]); jquery.get('/json/sim/help', null, function(data) { - var helpText = []; + var helpContent = []; data.children.forEach(function(prop) { if (prop.name === 'title') { self.helpTitle(prop.value); - } else if (prop.name == 'line') { - helpText.push(prop.value); + } else if (prop.name == 'line' ) { + helpContent.push({ + type: 'line', + text: prop.value, + }); + } else if (prop.name == 'text') { + helpContent.push({ + type: 'text', + text: prop.value, + }); + } else if (prop.name == 'key') { + var content = { + type: 'key', + name: 'noname', + desc: 'nothing', + } + helpContent.push(content); + prop.children.forEach(function(prop) { + if (prop.name === 'name') { + content.name = prop.value; + } else if( prop.name == 'desc' ) { + content.desc = prop.value; + } + }); } }); - self.helpText(helpText); + console.log(helpContent); + self.helpContent(helpContent); }); }