Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ia7 #685

Merged
merged 2 commits into from
Apr 4, 2017
Merged

Ia7 #685

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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