Skip to content

Commit

Permalink
IA7 v1.5.670 - persistent banners
Browse files Browse the repository at this point in the history
  • Loading branch information
hplato committed Aug 12, 2017
1 parent b82daa4 commit 7c42218
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
2 changes: 1 addition & 1 deletion web/ia7/house/main.shtml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
<div class='col-sm-12 col-sm-offset-0 col-md-10 col-md-offset-1 col-lg-8 col-lg-offset-2'>
<div class='col-sm-12'>
<p class="text-muted"><small> MisterHouse was created by Bruce Winter. Ron Klinkien developed the v2.3 web interface. Kevin Robert Keegan
designed the IA7 web prototype, updates by H.Plato. IA7 v1.5.650 Font Awesome by Dave Gandy - http://fontawesome.io</small></p>
designed the IA7 web prototype, updates by H.Plato. IA7 v1.5.670 Font Awesome by Dave Gandy - http://fontawesome.io</small></p>
</div>
</div>
</div>
Expand Down
23 changes: 17 additions & 6 deletions web/ia7/include/javascript.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// v1.5.650
// v1.5.670

var entity_store = {}; //global storage of entities
var json_store = {};
Expand Down Expand Up @@ -1459,13 +1459,21 @@ var get_notifications = function(time) {
var text = String(json.data[i].text);
var type = String(json.data[i].type);
var color = String(json.data[i].color);

var close = "";
var alert_class = "alert-message";
if (json.data[i].persistent !== undefined && json.data[i].persistent == "yes") {
close = "<button type='button' class='close' data-dismiss='alert'>x</button>";
alert_class = "alert-message-persist";
}
if ((type == "sound" ) || ((type == "speech") && (speech_sound == "yes"))) {
audio_play(document.getElementById('sound_element'),url)
if (url !== "undefined") {
console.log("in undefined url="+url);
audio_play(document.getElementById('sound_element'),url);
}
}
if (type == "banner" || ((type == "speech") && (speech_banner == "yes"))) {
var alert_type = "info";
if (color !== undefined) {
if (color !== "undefined") {
if (color == "green") {
alert_type = "success";
} else if (color == "red") {
Expand All @@ -1478,8 +1486,11 @@ var get_notifications = function(time) {
if ($(window).width() <= 768) { // override the responsive mobile top-buffer
mobile = "mobile-alert";
}
$("#alert-area").append($("<div class='alert-message alert alerts "+mobile+" alert-" + alert_type + " fade in' data-alert><p><i class='fa fa-info-circle'></i><strong> Notification:</strong> " + text + " </p></div>"));
$(".alert-message").delay(4000).fadeOut("slow", function () { $(this).remove(); });

$("#alert-area").append($("<div class='"+alert_class+" alert alerts "+mobile+" alert-" + alert_type + " fade in' data-alert>"+close+"<p><i class='fa fa-info-circle'></i><strong> Notification:</strong> " + text + " </p></div>"));
if (json.data[i].persistent == undefined || (json.data[i].persistent !== undefined && json.data[i].persistent == "no")) {
$(".alert-message").delay(4000).fadeOut("slow", function () { $(this).remove(); });
}
}
if (type == "alert") {
jAlert(text,'MH Notifications');
Expand Down

0 comments on commit 7c42218

Please sign in to comment.