From e1ae5203adb4f71879646416c58116e3717b6e3e Mon Sep 17 00:00:00 2001 From: Carlos Martinez Date: Fri, 6 May 2016 16:47:52 +0200 Subject: [PATCH 1/2] First draft tooltips --- webapp/bower.json | 3 ++- .../shico/trackerParameters.controller.js | 3 +++ .../components/shico/trackerParameters.service.js | 13 ++++++++++++- .../shico/trackerParameters.template.html | 5 ++++- webapp/src/app/index.module.js | 3 ++- webapp/src/help/algorithm.md | 2 ++ 6 files changed, 25 insertions(+), 4 deletions(-) create mode 100644 webapp/src/help/algorithm.md diff --git a/webapp/bower.json b/webapp/bower.json index 1fe0913..9d571bf 100644 --- a/webapp/bower.json +++ b/webapp/bower.json @@ -14,7 +14,8 @@ "angular-animate": "~1.4.8", "angular-busy": "~4.1.3", "nvd3": "https://github.com/c-martinez/nvd3.git#myrelease", - "ng-csv": "^0.3.6" + "ng-csv": "^0.3.6", + "angular-marked": "^1.2.0" }, "devDependencies": { "angular-mocks": "~1.4.2" diff --git a/webapp/src/app/components/shico/trackerParameters.controller.js b/webapp/src/app/components/shico/trackerParameters.controller.js index 3b49a78..6376870 100644 --- a/webapp/src/app/components/shico/trackerParameters.controller.js +++ b/webapp/src/app/components/shico/trackerParameters.controller.js @@ -14,5 +14,8 @@ // We use the parameters variable from ParameterService directly. vm.parameters = TrackerParametersService.getParameters(); + + // + vm.tooltips = TrackerParametersService.tooltips; } })(); diff --git a/webapp/src/app/components/shico/trackerParameters.service.js b/webapp/src/app/components/shico/trackerParameters.service.js index d449b6b..d2067a8 100644 --- a/webapp/src/app/components/shico/trackerParameters.service.js +++ b/webapp/src/app/components/shico/trackerParameters.service.js @@ -5,7 +5,7 @@ .module('shico') .service('TrackerParametersService', TrackerParametersService); - function TrackerParametersService() { + function TrackerParametersService($http, marked) { var vm = this; vm.parameters = { @@ -37,9 +37,13 @@ } }; + vm.tooltips = {}; + loadToolTip('/help/algorithm.md', 'algorithm'); + var service = { getParameters: getParameters, setParameters: setParameters, + tooltips: vm.tooltips, availableYears: vm.availableYears }; return service; @@ -68,5 +72,12 @@ vm.parameters.startKey = yearValues[idxYearFrom]; vm.parameters.endKey = yearValues[idxYearTo]; } + + function loadToolTip(url, ttKey) { + $http({method: 'GET',url: url}) + .success(function(content){ + vm.tooltips[ttKey] = marked(content); + }); + } } })(); diff --git a/webapp/src/app/components/shico/trackerParameters.template.html b/webapp/src/app/components/shico/trackerParameters.template.html index ff9a649..72f3275 100644 --- a/webapp/src/app/components/shico/trackerParameters.template.html +++ b/webapp/src/app/components/shico/trackerParameters.template.html @@ -36,7 +36,10 @@
- + + diff --git a/webapp/src/app/index.module.js b/webapp/src/app/index.module.js index a0bf628..08630b1 100644 --- a/webapp/src/app/index.module.js +++ b/webapp/src/app/index.module.js @@ -11,6 +11,7 @@ 'rzModule', 'cgBusy', 'ngSanitize', - 'ngCsv' + 'ngCsv', + 'hc.marked' ]); })(); diff --git a/webapp/src/help/algorithm.md b/webapp/src/help/algorithm.md new file mode 100644 index 0000000..e8e218a --- /dev/null +++ b/webapp/src/help/algorithm.md @@ -0,0 +1,2 @@ +# Testing algorithm documentation +This is *just* a **small** test. From 8de67c37b04d267d0ce2fe126a371388a0dce66f Mon Sep 17 00:00:00 2001 From: Carlos Martinez Date: Fri, 6 May 2016 17:38:04 +0200 Subject: [PATCH 2/2] Testing popup helps -- algorithm --- .../app/components/shico/trackerParameters.template.html | 4 +--- webapp/src/help/algorithm.md | 8 ++++++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/webapp/src/app/components/shico/trackerParameters.template.html b/webapp/src/app/components/shico/trackerParameters.template.html index 72f3275..f4ae08d 100644 --- a/webapp/src/app/components/shico/trackerParameters.template.html +++ b/webapp/src/app/components/shico/trackerParameters.template.html @@ -37,9 +37,7 @@
- + popover-trigger="click" popover-placement="bottom" for="algorithm">Algorithm: diff --git a/webapp/src/help/algorithm.md b/webapp/src/help/algorithm.md index e8e218a..aac182f 100644 --- a/webapp/src/help/algorithm.md +++ b/webapp/src/help/algorithm.md @@ -1,2 +1,6 @@ -# Testing algorithm documentation -This is *just* a **small** test. +### Algorithm + +The vocabulary monitor contains can use two different algorithms for generating vocabularies. These control which words are used as seed terms for each model: + + - The non-adaptive vocabulary generator uses the same seed terms each time to generate the related terms. + - The adaptive vocabulary generator uses the related terms generated by one semantic model as seed terms for the next semantic model. This adds an additional possibility: it allows for the semantic models to be used in chronological order, or in reverse chronological order -- searching forwards or backwards in time.