Skip to content

Commit

Permalink
Merge pull request #685 from hplato/ia7
Browse files Browse the repository at this point in the history
Ia7
  • Loading branch information
hplato authored Apr 4, 2017
2 parents ef71933 + 86b6888 commit 6b705b8
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 8 deletions.
18 changes: 13 additions & 5 deletions lib/json_server.pl
Original file line number Diff line number Diff line change
Expand Up @@ -528,8 +528,12 @@ sub json_get {
'type' => 'Category',
'members' => ''
};
if ( filter_object( $temp_object, \%args ) ) {
$json_data{objects}{$category} = $temp_object;
# if a time has been supplied, then the client data has been initialized, and we don't need to send it again
# if a category gets added, it won't refresh, but that's rare and this prevents the clients from continually sending data
unless ( $args{time} && $args{time}[0] > 0 ) {
if ( filter_object( $temp_object, \%args ) ) {
$json_data{objects}{$category} = $temp_object;
}
}
}

Expand All @@ -541,8 +545,12 @@ sub json_get {
'type' => 'Type',
'members' => ''
};
if ( filter_object( $temp_object, \%args ) ) {
$json_data{objects}{$type} = $temp_object;
# if a time has been supplied, then the client data has been initialized, and we don't need to send it again
# if a category gets added, it won't refresh, but that's rare and this prevents the clients from continually sending data
unless ( $args{time} && $args{time}[0] > 0 ) {
if ( filter_object( $temp_object, \%args ) ) {
$json_data{objects}{$type} = $temp_object;
}
}
}
}
Expand Down Expand Up @@ -922,7 +930,7 @@ sub json_object_detail {
#To avoid missed changes, since they can happen at the millisecond level, give a second's cushion
#Object has not changed since time, so return undefined
return;
}
}
}

my %json_objects;
Expand Down
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 v4 web prototype, updates by H.Plato. IA7 v1.3.620 Font Awesome by Dave Gandy - http://fontawesome.io</small></p>
designed the v4 web prototype, updates by H.Plato. IA7 v1.3.630 Font Awesome by Dave Gandy - http://fontawesome.io</small></p>
</div>
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions web/ia7/include/javascript.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// v1.3.610
// v1.3.630

var entity_store = {}; //global storage of entities
var json_store = {};
Expand Down Expand Up @@ -168,7 +168,7 @@ function changePage (){
notifications = "enabled";
}
}
if (getJSONDataByPath("collections") === undefined){
if (getJSONDataByPath("collections") === undefined || json_store.objects === undefined){
// We need at minimum the basic collections data to render all pages
// (the breadcrumb)
// NOTE may want to think about how to handle dynamic changes to the
Expand Down

0 comments on commit 6b705b8

Please sign in to comment.