diff --git a/code/common/ia7_collection_upgrader.pl b/code/common/ia7_collection_upgrader.pl index b8c8697db..8a6b37e04 100644 --- a/code/common/ia7_collection_upgrader.pl +++ b/code/common/ia7_collection_upgrader.pl @@ -1,6 +1,6 @@ # Category = IA7 -#@ IA7 v1.2 : This is a helper utility that can find and update collections.json files +#@ IA7 Collection Updater v1.3 : This is a helper utility that can find and update collections.json files #@ if any structural changes are required. #@ #@ v1.2 - add in new login system id 700 @@ -35,14 +35,14 @@ } push (@{$json_data->{500}->{children}},700) unless ($found); $json_data->{meta}->{version} = "1.2"; - print_log "[IA7_Collection_Updater] : Checking $file to version $ia7_coll_current_ver"; + print_log "[IA7_Collection_Updater] : Updating $file to version 1.2"; $updated = 1; } if ($updated) { my $json_newdata = to_json($json_data, {utf8 => 1, pretty => 1}); - my $backup_file = $file . ".v" . $version . ".backup"; + my $backup_file = $file . ".t" . int( ::get_tickcount() / 1000 ) . ".backup"; file_write($backup_file,$file_data); - print_log "[IA7_Collection_Updater] : Saved backup " . $file . ".v" . $version . ".backup"; + print_log "[IA7_Collection_Updater] : Saved backup " . $file . ".t" . int( ::get_tickcount() / 1000 ) . ".backup"; file_write($file,$json_newdata); } } diff --git a/lib/json_server.pl b/lib/json_server.pl index 8dc59fd71..3235573fa 100644 --- a/lib/json_server.pl +++ b/lib/json_server.pl @@ -38,6 +38,8 @@ =head2 METHODS =cut +#NOTE: Removed sort from line 454 for optimization. + use strict; use RRDTool::Rawish; @@ -215,8 +217,8 @@ sub json_get { print_log "Json_Server.pl: Client override section for $Http{Client_address} found"; for my $key ( - keys $json_data{'ia7_config'}->{clients} - ->{ $Http{Client_address} } ) + keys %{$json_data{'ia7_config'}->{clients} + ->{ $Http{Client_address} }} ) { print_log "Json_Server.pl: Client key=$key, value = $json_data{'ia7_config'}->{clients}->{$Http{Client_address}}->{$key}"; @@ -450,7 +452,8 @@ sub json_get { push @objects, &list_objects_by_type($object_type); } } - foreach my $o ( map { &get_object_by_name($_) } sort @objects ) { +# foreach my $o ( map { &get_object_by_name($_) } sort @objects ) { + foreach my $o ( map { &get_object_by_name($_) } @objects ) { next unless $o; my $name = $o; $name = $o->{object_name}; @@ -1033,7 +1036,7 @@ sub json_page { my ($json_raw) = @_; my $json; - #utf8::encode( $json_raw ); #may need to wrap gzip in an eval and encode it if errors develop. It crashes if a < is in the text +## utf8::encode( $json_raw ); #may need to wrap gzip in an eval and encode it if errors develop. It crashes if a < is in the text gzip \$json_raw => \$json; my $output = "HTTP/1.0 200 OK\r\n"; $output .= "Server: MisterHouse\r\n"; @@ -1041,6 +1044,7 @@ sub json_page { $output .= "Content-Encoding: gzip\r\n"; $output .= "\r\n"; $output .= $json; +## $output .= $json_raw; return $output; } diff --git a/web/ia7/include/javascript.js b/web/ia7/include/javascript.js index ef70b9a34..f94874e7a 100644 --- a/web/ia7/include/javascript.js +++ b/web/ia7/include/javascript.js @@ -1689,9 +1689,29 @@ var fp_reposition_entities = function(){ "left": newx }; }; - var nwidth = $("#fp_graphic").get(0).naturalWidth; - fp_scale = Math.round( width/nwidth * 100); +// var nwidth = $("#fp_graphic").get(0).naturalWidth; +// var nwidth = $("#fp_graphic").width(); + var nwidth; +//There are 2 sizing jumps in bootstrap.min.css one at 992 and another at 1200 +//Scale icons if less than 991 +//1-991 +//@992 = 821 (171) +//@993 = 822 +//@995 = 824 +//@994 = 828 (166) +//@1100 = 991 (109) +//@1200 = 790 + if (width < 992) { + nwidth = 992; + } else if (width < 1200) { + nwidth = 822; + } else { + nwidth = 790; + } + fp_scale = Math.round( width/nwidth * 100); + + console.log("width="+width+" nwidth="+nwidth+" scale="+fp_scale); // update the location of all the objects... $(".floorplan_item").each(function(index) { var classstr = $(this).attr("class");