Get new outreach engine working.

This commit is contained in:
Kevin Dungs
2014-11-08 15:55:00 +01:00
parent c452bc52cf
commit 88ddebc980
6 changed files with 62 additions and 25 deletions
+15 -1
View File
@@ -21,13 +21,26 @@ var UI = (function () {
});
/** Show a bootstrap modal with dynamic content. */
var showModal = function(title, text) {
var showModal = function(title, text, level) {
var $modal = $('#infoBox');
$modal.find('#infoBoxLabel').html(title);
$modal.find('.modal-body').html(text);
$modal.modal({show: true});
};
/** Display only the elements with data-min-level above a certain
* threshold.
*/
var showLevels = function(level) {
$('#infoBox').find('[data-min-level]').each(function() {
if (level >= $(this).data('min-level')) {
$(this).show();
} else {
$(this).hide();
}
});
};
var showUpdateValue = function(ident, num) {
if (num != 0) {
var formatted = Helpers.formatNumberPostfix(num);
@@ -92,6 +105,7 @@ var UI = (function () {
return {
showModal: showModal,
showLevels: showLevels,
showUpdateValue: showUpdateValue,
validateVersion: validateVersion
}