diff options
| author | Alon Levy <alon@pobox.com> | 2014-12-04 21:13:27 +0200 |
|---|---|---|
| committer | Alon Levy <alon@pobox.com> | 2014-12-04 21:13:27 +0200 |
| commit | c16eb894ade649b0f1b2454e21e2a2bda2c0a384 (patch) | |
| tree | 23a89d4ea5d210b40c930d003c511c86cbea0d43 /src | |
| parent | 8667f30230495b536ee208ca1e979ac345b3ce21 (diff) | |
move nodetypes to consts, add descriptions. Fixes #48
Diffstat (limited to 'src')
| -rw-r--r-- | src/consts.js | 14 | ||||
| -rw-r--r-- | src/textanalysis.js | 2 | ||||
| -rw-r--r-- | src/textanalysis.ui.js | 9 |
3 files changed, 22 insertions, 3 deletions
diff --git a/src/consts.js b/src/consts.js index cfcdd1c2..4b21dc70 100644 --- a/src/consts.js +++ b/src/consts.js @@ -1,11 +1,25 @@ "use strict" define(function() { + + var nodetypes = ["person", "club", "skill", "interest", "third-internship-proposal", "internship"]; + + var description = { + person: 'Depict a person, real or fictional', + club: undefined, + skill: 'Depicts a specific ability of expertise a person can have', + interest: undefined, + 'third-internship-proposal': undefined, + internship: undefined, + }; + // TODO: enums, sometime return { KEYSTROKE_WHERE_EDIT_NODE: 'keystroke_where_edit_node', KEYSTROKE_WHERE_DOCUMENT: 'keystroke_where_document', KEYSTROKE_WHERE_TEXTANALYSIS: 'keystroke_where_textanalysis', INPUT_WHERE_TEXTANALYSIS: 'input_where_textanalysis', + nodetypes: nodetypes, + description: description, }; }); diff --git a/src/textanalysis.js b/src/textanalysis.js index 44765916..98ca8aea 100644 --- a/src/textanalysis.js +++ b/src/textanalysis.js @@ -4,7 +4,7 @@ define(['rz_core', 'model/core', 'model/util', 'model/diff', 'rz_bus', 'consts'] function(rz_core, model_core, model_util, model_diff, rz_bus, consts) { var typeindex = 0; -var nodetypes = ["person", "club", "skill", "interest", "third-internship-proposal", "internship"]; +var nodetypes = consts.nodetypes; var typeStack = []; var lastnode; diff --git a/src/textanalysis.ui.js b/src/textanalysis.ui.js index 5756fce0..b7863271 100644 --- a/src/textanalysis.ui.js +++ b/src/textanalysis.ui.js @@ -7,7 +7,8 @@ var text = "", // Last text of sentence element_name = '#textanalyser', element = $(element_name), suggestionChange, - plus_button = $('.add-button'); + plus_button = $('.add-button'), + description = consts.description; var typeselection = function TypeSelectionDialog() { var e = $('.typeselection'), @@ -27,7 +28,11 @@ var typeselection = function TypeSelectionDialog() { e.css('left', 0); } typeselection.showChosenType = function(nodetype) { - e.html('<table><tr><td style="height:28px"></td></tr><tr><td>' + "Chosen Type: " + nodetype + '</td></tr></table>'); + var desc = description[nodetype]; + e.html('<table><tr><td style="height:28px"></td></tr><tr><td>' + + "Chosen Type: " + nodetype + '</td></tr>' + + (desc ? '<tr><td>' + desc + '</td></tr>' : '') + + '</table>'); } return typeselection; }(); |
