diff options
22 files changed, 161 insertions, 48 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 387d90114..283eff424 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -52,6 +52,7 @@ - Fix issue with inspector duplication workflow. - Fix removal of cached photos on moderation. #2696 - Checking of cached front page details against database. #2696 + - Inconsistent display of mark private checkbox for staff users - Development improvements: - Upgrade the underlying framework and a number of other packages. #2473 - Add feature cobrand helper function. diff --git a/perllib/FixMyStreet/App/Controller/Around.pm b/perllib/FixMyStreet/App/Controller/Around.pm index 377449719..49ff13999 100644 --- a/perllib/FixMyStreet/App/Controller/Around.pm +++ b/perllib/FixMyStreet/App/Controller/Around.pm @@ -235,6 +235,7 @@ sub check_and_stash_category : Private { my $csv = Text::CSV->new(); $csv->combine(@list_of_names); $c->stash->{around_bodies} = \@bodies; + $c->stash->{bodies_ids} = [ map { $_->id } @bodies]; $c->{stash}->{list_of_names_as_string} = $csv->string; my $where = { body_id => [ keys %bodies ], }; diff --git a/perllib/FixMyStreet/App/Controller/Report/New.pm b/perllib/FixMyStreet/App/Controller/Report/New.pm index b748a34e0..270ad2ddb 100644 --- a/perllib/FixMyStreet/App/Controller/Report/New.pm +++ b/perllib/FixMyStreet/App/Controller/Report/New.pm @@ -749,6 +749,7 @@ sub setup_categories_and_bodies : Private { $c->stash->{bodies} = \%bodies; $c->stash->{contacts} = \@contacts; $c->stash->{bodies_to_list} = \%bodies_to_list; + $c->stash->{bodies_ids} = [ map { $_->id } @bodies]; $c->stash->{category_options} = \@category_options; $c->stash->{category_extras} = \%category_extras; $c->stash->{category_extras_hidden} = \%category_extras_hidden; diff --git a/perllib/FixMyStreet/Cobrand/Bexley.pm b/perllib/FixMyStreet/Cobrand/Bexley.pm index eda276add..93484dc68 100644 --- a/perllib/FixMyStreet/Cobrand/Bexley.pm +++ b/perllib/FixMyStreet/Cobrand/Bexley.pm @@ -9,7 +9,7 @@ sub council_area { 'Bexley' } sub council_name { 'London Borough of Bexley' } sub council_url { 'bexley' } sub get_geocoder { 'Bexley' } -sub map_type { 'Bexley' } +sub map_type { 'MasterMap' } sub disambiguate_location { my $self = shift; diff --git a/perllib/FixMyStreet/Cobrand/FixMyStreet.pm b/perllib/FixMyStreet/Cobrand/FixMyStreet.pm index 0d2bf3663..bf7690990 100644 --- a/perllib/FixMyStreet/Cobrand/FixMyStreet.pm +++ b/perllib/FixMyStreet/Cobrand/FixMyStreet.pm @@ -256,10 +256,8 @@ sub about_hook { } } -sub updates_disallowed { - my $self = shift; - my ($problem) = @_; - my $c = $self->{c}; +sub updates_disallowed_config { + my ($self, $problem) = @_; # This is a hash of council name to match, and what to do my $cfg = $self->feature('updates_allowed') || {}; @@ -273,6 +271,15 @@ sub updates_disallowed { last; } } + return ($type, $body); +} + +sub updates_disallowed { + my $self = shift; + my ($problem) = @_; + my $c = $self->{c}; + + my ($type, $body) = $self->updates_disallowed_config($problem); if ($type eq 'none') { return 1; diff --git a/perllib/FixMyStreet/Cobrand/Peterborough.pm b/perllib/FixMyStreet/Cobrand/Peterborough.pm index eb4ab815c..fcdf44859 100644 --- a/perllib/FixMyStreet/Cobrand/Peterborough.pm +++ b/perllib/FixMyStreet/Cobrand/Peterborough.pm @@ -12,6 +12,7 @@ sub council_area_id { 2566 } sub council_area { 'Peterborough' } sub council_name { 'Peterborough City Council' } sub council_url { 'peterborough' } +sub map_type { 'MasterMap' } sub send_questionnaires { 0 } diff --git a/perllib/FixMyStreet/Map/Bexley.pm b/perllib/FixMyStreet/Map/MasterMap.pm index d3c7a013a..a2e0acd54 100644 --- a/perllib/FixMyStreet/Map/Bexley.pm +++ b/perllib/FixMyStreet/Map/MasterMap.pm @@ -1,8 +1,8 @@ -# FixMyStreet:Map::Bexley +# FixMyStreet:Map::MasterMap # # A combination of FMS OS maps and our own tiles -package FixMyStreet::Map::Bexley; +package FixMyStreet::Map::MasterMap; use base 'FixMyStreet::Map::FMS'; use strict; @@ -16,14 +16,14 @@ sub map_javascript { [ '/js/map-OpenLayers.js', '/js/map-bing-ol.js', '/js/map-fms.js', - '/js/map-bexley.js', + '/js/map-mastermap.js', ] } sub map_tiles { my ( $self, %params ) = @_; my ( $x, $y, $z ) = ( $params{x_tile}, $params{y_tile}, $params{zoom_act} ); if ($z >= 17) { - my $base = "//%stilma.mysociety.org/bexley/%d/%d/%d.png"; + my $base = "//%stilma.mysociety.org/mastermap/%d/%d/%d.png"; return [ sprintf($base, 'a.', $z, $x-1, $y-1), sprintf($base, 'b.', $z, $x, $y-1), diff --git a/perllib/FixMyStreet/Script/Alerts.pm b/perllib/FixMyStreet/Script/Alerts.pm index 3d2d784b8..14d6ec479 100644 --- a/perllib/FixMyStreet/Script/Alerts.pm +++ b/perllib/FixMyStreet/Script/Alerts.pm @@ -97,7 +97,7 @@ sub send() { !( $last_problem_state eq '' && $row->{item_problem_state} eq 'confirmed' ) && $last_problem_state ne $row->{item_problem_state} ) { - my $state = FixMyStreet::DB->resultset("State")->display($row->{item_problem_state}, 1, $cobrand); + my $state = FixMyStreet::DB->resultset("State")->display($row->{item_problem_state}, 1, $cobrand->moniker); my $update = _('State changed to:') . ' ' . $state; $row->{item_text} = $row->{item_text} ? $row->{item_text} . "\n\n" . $update : diff --git a/t/cobrand/bexley.t b/t/cobrand/bexley.t index 3cf71798e..6b618762f 100644 --- a/t/cobrand/bexley.t +++ b/t/cobrand/bexley.t @@ -6,7 +6,6 @@ use Catalyst::Test 'FixMyStreet::App'; use_ok 'FixMyStreet::Cobrand::Bexley'; use_ok 'FixMyStreet::Geocode::Bexley'; -use_ok 'FixMyStreet::Map::Bexley'; my $ukc = Test::MockModule->new('FixMyStreet::Cobrand::UKCouncils'); $ukc->mock('lookup_site_code', sub { @@ -43,7 +42,6 @@ $category->update; FixMyStreet::override_config { ALLOWED_COBRANDS => [ 'bexley' ], MAPIT_URL => 'http://mapit.uk/', - MAP_TYPE => 'Bexley', STAGING_FLAGS => { send_reports => 1, skip_checks => 0 }, COBRAND_FEATURES => { open311_email => { bexley => { p1 => 'p1@bexley', lighting => 'thirdparty@notbexley.example.com,another@notbexley.example.com' } } }, }, sub { @@ -183,23 +181,6 @@ subtest 'nearest road returns correct road' => sub { is $cobrand->_nearest_feature($cfg, 545451, 174380, $features), '20101226'; }; -subtest 'correct map tiles used' => sub { - my %test = ( - 16 => [ '-', 'oml' ], - 20 => [ '.', 'bexley' ] - ); - foreach my $zoom (qw(16 20)) { - my $tiles = FixMyStreet::Map::Bexley->map_tiles(x_tile => 123, y_tile => 456, zoom_act => $zoom); - my ($sep, $lyr) = @{$test{$zoom}}; - is_deeply $tiles, [ - "//a${sep}tilma.mysociety.org/$lyr/$zoom/122/455.png", - "//b${sep}tilma.mysociety.org/$lyr/$zoom/123/455.png", - "//c${sep}tilma.mysociety.org/$lyr/$zoom/122/456.png", - "//tilma.mysociety.org/$lyr/$zoom/123/456.png", - ]; - } -}; - my $geo = Test::MockModule->new('FixMyStreet::Geocode'); $geo->mock('cache', sub { my $typ = shift; diff --git a/t/cobrand/isleofwight.t b/t/cobrand/isleofwight.t index 1d22eb517..9e1b80c68 100644 --- a/t/cobrand/isleofwight.t +++ b/t/cobrand/isleofwight.t @@ -104,6 +104,7 @@ subtest "only original reporter can comment" => sub { FixMyStreet::override_config { MAPIT_URL => 'http://mapit.uk/', ALLOWED_COBRANDS => 'isleofwight', + COBRAND_FEATURES => { updates_allowed => { isleofwight => 'reporter' } }, }, sub { $mech->get_ok('/report/' . $reports[0]->id); $mech->content_contains('Only the original reporter may leave updates'); diff --git a/t/cobrand/oxfordshire.t b/t/cobrand/oxfordshire.t index b8422a28b..dd5eedc8d 100644 --- a/t/cobrand/oxfordshire.t +++ b/t/cobrand/oxfordshire.t @@ -1,6 +1,7 @@ use Test::MockModule; use FixMyStreet::TestMech; +use FixMyStreet::Script::Alerts; my $mech = FixMyStreet::TestMech->new; my $oxon = $mech->create_body_ok(2237, 'Oxfordshire County Council'); @@ -61,6 +62,49 @@ subtest 'can use customer reference to search for reports' => sub { }; }; +my $user = $mech->create_user_ok( 'user@example.com', name => 'Test User' ); +my $user2 = $mech->create_user_ok( 'user2@example.com', name => 'Test User2' ); + +subtest 'check unable to fix label' => sub { + FixMyStreet::override_config { + ALLOWED_COBRANDS => [ 'oxfordshire' ], + MAPIT_URL => 'http://mapit.uk/', + }, sub { + my $problem = $problems[0]; + $problem->state( 'unable to fix' ); + $problem->update; + + my $alert = FixMyStreet::DB->resultset('Alert')->create( { + parameter => $problem->id, + alert_type => 'new_updates', + cobrand => 'oxfordshire', + user => $user, + } )->confirm; + + FixMyStreet::DB->resultset('Comment')->create( { + problem_state => 'unable to fix', + problem_id => $problem->id, + user_id => $user2->id, + name => 'User', + mark_fixed => 'f', + text => "this is an update", + state => 'confirmed', + confirmed => 'now()', + anonymous => 'f', + } ); + + + $mech->get_ok('/report/' . $problem->id); + $mech->content_contains('Investigation complete'); + + FixMyStreet::Script::Alerts::send(); + $mech->email_count_is(1); + my $email = $mech->get_email; + my $body = $mech->get_text_body_from_email($email); + like $body, qr/Investigation complete/, 'state correct in email'; + }; +}; + END { done_testing(); } diff --git a/t/map/mastermap.t b/t/map/mastermap.t new file mode 100644 index 000000000..109142379 --- /dev/null +++ b/t/map/mastermap.t @@ -0,0 +1,22 @@ +use FixMyStreet::TestMech; + +use FixMyStreet::Map::MasterMap; + +subtest 'correct map tiles used' => sub { + my %test = ( + 16 => [ '-', 'oml' ], + 20 => [ '.', 'mastermap' ] + ); + foreach my $zoom (qw(16 20)) { + my $tiles = FixMyStreet::Map::MasterMap->map_tiles(x_tile => 123, y_tile => 456, zoom_act => $zoom); + my ($sep, $lyr) = @{$test{$zoom}}; + is_deeply $tiles, [ + "//a${sep}tilma.mysociety.org/$lyr/$zoom/122/455.png", + "//b${sep}tilma.mysociety.org/$lyr/$zoom/123/455.png", + "//c${sep}tilma.mysociety.org/$lyr/$zoom/122/456.png", + "//tilma.mysociety.org/$lyr/$zoom/123/456.png", + ]; + } +}; + +done_testing(); diff --git a/t/map/tests.t b/t/map/tests.t index f1f29dc06..499447ad5 100644 --- a/t/map/tests.t +++ b/t/map/tests.t @@ -2,7 +2,6 @@ use FixMyStreet::Map; use Test::More; my $requires = { - 'Bexley' => 'map-bexley.js', 'Bing' => 'map-bing-ol.js', 'Bristol' => 'map-wmts-bristol.js', 'Bromley' => 'map-fms.js', @@ -14,6 +13,7 @@ my $requires = { 'Hounslow' => 'map-wmts-hounslow.js', 'IsleOfWight' => 'map-wmts-isleofwight.js', 'OSM' => 'OpenStreetMap.js', + 'MasterMap' => 'map-mastermap.js', 'CycleMap' => 'OpenStreetMap.js', 'MapQuest' => 'OpenStreetMap.js', 'StreetView' => 'map-streetview.js', diff --git a/templates/web/base/report/new/form_user_loggedin.html b/templates/web/base/report/new/form_user_loggedin.html index 95fc9d751..d657be450 100644 --- a/templates/web/base/report/new/form_user_loggedin.html +++ b/templates/web/base/report/new/form_user_loggedin.html @@ -6,9 +6,9 @@ [% INCLUDE form_as %] </div> [% ELSE %] - [% can_contribute_as_another_user = c.user.has_permission_to("contribute_as_another_user", bodies.keys) %] - [% can_contribute_as_anonymous_user = c.user.has_permission_to("contribute_as_anonymous_user", bodies.keys) %] - [% can_contribute_as_body = c.user.from_body AND c.user.has_permission_to("contribute_as_body", bodies.keys) %] + [% can_contribute_as_another_user = c.user.has_permission_to("contribute_as_another_user", bodies_ids) %] + [% can_contribute_as_anonymous_user = c.user.has_permission_to("contribute_as_anonymous_user", bodies_ids) %] + [% can_contribute_as_body = c.user.from_body AND c.user.has_permission_to("contribute_as_body", bodies_ids) %] [% IF can_contribute_as_another_user OR can_contribute_as_anonymous_user OR can_contribute_as_body %] [% INCLUDE form_as %] [% END %] @@ -61,7 +61,7 @@ <input class="form-control" type="text" value="[% report.user.email | html %]" name="email" id="form_email"> [% END %] -[% IF c.user.has_permission_to("report_inspect", bodies.keys) OR c.user.has_permission_to("report_mark_private", bodies.keys) %] +[% IF c.user.has_permission_to("report_inspect", bodies_ids) OR c.user.has_permission_to("report_mark_private", bodies_ids) %] <div class="checkbox-group"> <input type="checkbox" name="non_public" id="form_non_public" value="1"[% ' checked' IF report.non_public %]> <label class="inline" for="form_non_public">[% loc('Private') %] </label> diff --git a/templates/web/bathnes/report/new/roads_message.html b/templates/web/bathnes/report/new/roads_message.html new file mode 100644 index 000000000..3060f16da --- /dev/null +++ b/templates/web/bathnes/report/new/roads_message.html @@ -0,0 +1,7 @@ +<div id="js-roads-responsibility" class="box-warning hidden"> + <strong>Not maintained by Bath & North East Somerset Council</strong> + <div id="js-not-a-road" class="hidden js-responsibility-message"> + <p>The location you have selected doesn't appear to be on <span class="js-roads-asset" data-original="a road">a road</span> that Bath & North East Somerset Council maintain.</p> + <p>Please select <span class="js-roads-asset" data-original="a road">a road</span> on which to make a report.</p> + </div> +</div> diff --git a/templates/web/fixmystreet-uk-councils/report/_updates_disallowed_message.html b/templates/web/fixmystreet-uk-councils/report/_updates_disallowed_message.html new file mode 100644 index 000000000..3a2dda03e --- /dev/null +++ b/templates/web/fixmystreet-uk-councils/report/_updates_disallowed_message.html @@ -0,0 +1,17 @@ +[% cfg = c.cobrand.feature("updates_allowed") ~%] +[% IF cfg.match('reporter') AND (NOT cfg.match('open') OR problem.is_open) %] + <p> + Only the original reporter may leave updates. + [% IF NOT c.user_exists %] + If you made the original report please + <a href="/auth?r=report/[% problem.id %]">log in</a> + to leave an update. + [% END %] + </p> +[% ELSE %] + <p>[% loc('This report is now closed to updates.') %] + [% tprintf(loc('You can <a href="%s">make a new report in the same location</a>.'), + c.uri_for( '/report/new', { longitude = longitude, latitude = latitude } ) + ) %] + </p> +[% END %] diff --git a/templates/web/fixmystreet.com/report/_updates_disallowed_message.html b/templates/web/fixmystreet.com/report/_updates_disallowed_message.html new file mode 100644 index 000000000..d2d9cf83b --- /dev/null +++ b/templates/web/fixmystreet.com/report/_updates_disallowed_message.html @@ -0,0 +1,17 @@ +[% cfg = c.cobrand.updates_disallowed_config(problem).0 ~%] +[% IF cfg.match('reporter') AND (NOT cfg.match('open') OR problem.is_open) %] + <p> + Only the original reporter may leave updates. + [% IF NOT c.user_exists %] + If you made the original report please + <a href="/auth?r=report/[% problem.id %]">log in</a> + to leave an update. + [% END %] + </p> +[% ELSE %] + <p>[% loc('This report is now closed to updates.') %] + [% tprintf(loc('You can <a href="%s">make a new report in the same location</a>.'), + c.uri_for( '/report/new', { longitude = longitude, latitude = latitude } ) + ) %] + </p> +[% END %] diff --git a/templates/web/isleofwight/report/_updates_disallowed_message.html b/templates/web/isleofwight/report/_updates_disallowed_message.html deleted file mode 100644 index af56f73b1..000000000 --- a/templates/web/isleofwight/report/_updates_disallowed_message.html +++ /dev/null @@ -1,8 +0,0 @@ -<p> - Only the original reporter may leave updates. - [% IF NOT c.user_exists %] - If you made the original report please - <a href="/auth?r=report/[% problem.id %]">log in</a> - to leave an update. - [% END %] -</p> diff --git a/web/cobrands/bathnes/assets.js b/web/cobrands/bathnes/assets.js index 7a32facc9..f508ca97c 100644 --- a/web/cobrands/bathnes/assets.js +++ b/web/cobrands/bathnes/assets.js @@ -201,6 +201,27 @@ fixmystreet.assets.add(fixmystreet.maps.banes_defaults, { attribute: 'usrn', field: 'site_code' }, + road: true, + asset_item: "road", + asset_type: 'road', + all_categories: true, // Not really, but want to allow on all but one, not stop + no_asset_msg_id: '#js-not-a-road', + cat_map: { + 'Damage to pavement': 'pavement', + 'Damage to road': 'road' + }, + actions: { + found: fixmystreet.message_controller.road_found, + not_found: function(layer) { + var cat = $('select#form_category').val(); + if (cat === 'Damage to pavement' || cat === 'Damage to road') { + layer.fixmystreet.asset_item = layer.fixmystreet.cat_map[cat]; + fixmystreet.message_controller.road_not_found(layer); + } else { + fixmystreet.message_controller.road_found(layer); + } + } + }, name: "Adopted Highways", attribution: " © Crown Copyright. All rights reserved. 1000233344" }); diff --git a/web/js/map-bexley.js b/web/js/map-mastermap.js index 38911f950..d12a79bd0 100644 --- a/web/js/map-bexley.js +++ b/web/js/map-mastermap.js @@ -1,11 +1,11 @@ fixmystreet.maps.config = (function(original) { return function(){ original(); - fixmystreet.map_type = OpenLayers.Layer.Bexley; + fixmystreet.map_type = OpenLayers.Layer.MasterMap; }; })(fixmystreet.maps.config); -OpenLayers.Layer.Bexley = OpenLayers.Class(OpenLayers.Layer.BingUK, { +OpenLayers.Layer.MasterMap = OpenLayers.Class(OpenLayers.Layer.BingUK, { get_urls: function(bounds, z) { if (z < 17) { return OpenLayers.Layer.BingUK.prototype.get_urls.apply(this, arguments); @@ -13,12 +13,12 @@ OpenLayers.Layer.Bexley = OpenLayers.Class(OpenLayers.Layer.BingUK, { var urls = []; var servers = [ '', 'a.', 'b.', 'c.' ]; - var base = "//{S}tilma.mysociety.org/bexley/${z}/${x}/${y}.png"; + var base = "//{S}tilma.mysociety.org/mastermap/${z}/${x}/${y}.png"; for (var i=0; i < servers.length; i++) { urls.push( base.replace('{S}', servers[i]) ); } return urls; }, - CLASS_NAME: "OpenLayers.Layer.Bexley" + CLASS_NAME: "OpenLayers.Layer.MasterMap" }); diff --git a/web/vendor/OpenLayers/OpenLayers.wmts.js b/web/vendor/OpenLayers/OpenLayers.wmts.js index 388de520f..8c9121940 100644 --- a/web/vendor/OpenLayers/OpenLayers.wmts.js +++ b/web/vendor/OpenLayers/OpenLayers.wmts.js @@ -528,7 +528,7 @@ e.hostname,d=d[4],e=e.port;if(80!=d&&""!=d||"80"!=e&&""!=e)c=c&&d==e}c||b&&(a="f requestUrl:e})};!1===a.async?d.send(a.data):window.setTimeout(function(){0!==d.readyState&&d.send(a.data)},0);return d},runCallbacks:function(a){var b=a.request,c=a.config,d=c.scope?OpenLayers.Function.bind(c.callback,c.scope):c.callback,e;c.success&&(e=c.scope?OpenLayers.Function.bind(c.success,c.scope):c.success);var f;c.failure&&(f=c.scope?OpenLayers.Function.bind(c.failure,c.scope):c.failure);"file:"==OpenLayers.Util.createUrlObject(c.url).protocol&&b.responseText&&(b.status=200);d(b);if(!b.status|| 200<=b.status&&300>b.status)this.events.triggerEvent("success",a),e&&e(b);b.status&&(200>b.status||300<=b.status)&&(this.events.triggerEvent("failure",a),f&&f(b))},GET:function(a){a=OpenLayers.Util.extend(a,{method:"GET"});return OpenLayers.Request.issue(a)},POST:function(a){a=OpenLayers.Util.extend(a,{method:"POST"});a.headers=a.headers?a.headers:{};"CONTENT-TYPE"in OpenLayers.Util.upperCaseObject(a.headers)||(a.headers["Content-Type"]="application/xml");return OpenLayers.Request.issue(a)},PUT:function(a){a= OpenLayers.Util.extend(a,{method:"PUT"});a.headers=a.headers?a.headers:{};"CONTENT-TYPE"in OpenLayers.Util.upperCaseObject(a.headers)||(a.headers["Content-Type"]="application/xml");return OpenLayers.Request.issue(a)},DELETE:function(a){a=OpenLayers.Util.extend(a,{method:"DELETE"});return OpenLayers.Request.issue(a)},HEAD:function(a){a=OpenLayers.Util.extend(a,{method:"HEAD"});return OpenLayers.Request.issue(a)},OPTIONS:function(a){a=OpenLayers.Util.extend(a,{method:"OPTIONS"});return OpenLayers.Request.issue(a)}});(function(){function a(){this._object=f&&!k?new f:new window.ActiveXObject("Microsoft.XMLHTTP");this._listeners=[]}function b(){return new a}function c(a){b.onreadystatechange&&b.onreadystatechange.apply(a);a.dispatchEvent({type:"readystatechange",bubbles:!1,cancelable:!1,timeStamp:new Date+0})}function d(a){try{a.responseText=a._object.responseText}catch(b){}try{var c;var d=a._object,e=d.responseXML,f=d.responseText;h&&f&&e&&!e.documentElement&&d.getResponseHeader("Content-Type").match(/[^\/]+\/[^\+]+\+xml/)&& -(e=new window.ActiveXObject("Microsoft.XMLDOM"),e.async=!1,e.validateOnParse=!1,e.loadXML(f));c=e&&(h&&0!=e.parseError||!e.documentElement||e.documentElement&&"parsererror"==e.documentElement.tagName)?null:e;a.responseXML=c}catch(b){}try{a.status=a._object.status}catch(b){}try{a.statusText=a._object.statusText}catch(b){}}function e(a){a._object.onreadystatechange=new window.Function}var f=window.XMLHttpRequest,g=!!window.controllers,h=window.document.all&&!window.opera,k=h&&window.navigator.userAgent.match(/MSIE 7.0/); +(e=new window.ActiveXObject("Microsoft.XMLDOM"),e.async=!1,e.validateOnParse=!1,e.loadXML(f));c=e&&(h&&0!=e.parseError||!e.documentElement||e.documentElement&&"parsererror"==e.documentElement.tagName)?null:e;a.responseXML=c}catch(b){}try{a.status=a._object.status}catch(b){}try{a.statusText=a._object.statusText}catch(b){}}function e(a){a._object.onreadystatechange=null}var f=window.XMLHttpRequest,g=!!window.controllers,h=window.document.all&&!window.opera,k=h&&window.navigator.userAgent.match(/MSIE 7.0/); b.prototype=a.prototype;g&&f.wrapped&&(b.wrapped=f.wrapped);b.UNSENT=0;b.OPENED=1;b.HEADERS_RECEIVED=2;b.LOADING=3;b.DONE=4;b.prototype.readyState=b.UNSENT;b.prototype.responseText="";b.prototype.responseXML=null;b.prototype.status=0;b.prototype.statusText="";b.prototype.priority="NORMAL";b.prototype.onreadystatechange=null;b.onreadystatechange=null;b.onopen=null;b.onsend=null;b.onabort=null;b.prototype.open=function(a,f,k,q,n){delete this._headers;3>arguments.length&&(k=!0);this._async=k;var p=this, t=this.readyState,u;h&&k&&(u=function(){t!=b.DONE&&(e(p),p.abort())},window.attachEvent("onunload",u));b.onopen&&b.onopen.apply(this,arguments);4<arguments.length?this._object.open(a,f,k,q,n):3<arguments.length?this._object.open(a,f,k,q):this._object.open(a,f,k);this.readyState=b.OPENED;c(this);this._object.onreadystatechange=function(){if(!g||k)p.readyState=p._object.readyState,d(p),p._aborted?p.readyState=b.UNSENT:(p.readyState==b.DONE&&(delete p._data,e(p),h&&k&&window.detachEvent("onunload",u)), t!=p.readyState&&c(p),t=p.readyState)}};b.prototype.send=function(a){b.onsend&&b.onsend.apply(this,arguments);arguments.length||(a=null);a&&a.nodeType&&(a=window.XMLSerializer?(new window.XMLSerializer).serializeToString(a):a.xml,this._headers["Content-Type"]||this._object.setRequestHeader("Content-Type","application/xml"));this._data=a;a:if(this._object.send(this._data),g&&!this._async)for(this.readyState=b.OPENED,d(this);this.readyState<b.DONE;)if(this.readyState++,c(this),this._aborted)break a}; diff --git a/web/vendor/OpenLayers/OpenLayers.zurich.js b/web/vendor/OpenLayers/OpenLayers.zurich.js index 9b4f9bcb0..29dcd62f5 100644 --- a/web/vendor/OpenLayers/OpenLayers.zurich.js +++ b/web/vendor/OpenLayers/OpenLayers.zurich.js @@ -528,7 +528,7 @@ e.hostname,d=d[4],e=e.port;if(80!=d&&""!=d||"80"!=e&&""!=e)c=c&&d==e}c||b&&(a="f requestUrl:e})};!1===a.async?d.send(a.data):window.setTimeout(function(){0!==d.readyState&&d.send(a.data)},0);return d},runCallbacks:function(a){var b=a.request,c=a.config,d=c.scope?OpenLayers.Function.bind(c.callback,c.scope):c.callback,e;c.success&&(e=c.scope?OpenLayers.Function.bind(c.success,c.scope):c.success);var f;c.failure&&(f=c.scope?OpenLayers.Function.bind(c.failure,c.scope):c.failure);"file:"==OpenLayers.Util.createUrlObject(c.url).protocol&&b.responseText&&(b.status=200);d(b);if(!b.status|| 200<=b.status&&300>b.status)this.events.triggerEvent("success",a),e&&e(b);b.status&&(200>b.status||300<=b.status)&&(this.events.triggerEvent("failure",a),f&&f(b))},GET:function(a){a=OpenLayers.Util.extend(a,{method:"GET"});return OpenLayers.Request.issue(a)},POST:function(a){a=OpenLayers.Util.extend(a,{method:"POST"});a.headers=a.headers?a.headers:{};"CONTENT-TYPE"in OpenLayers.Util.upperCaseObject(a.headers)||(a.headers["Content-Type"]="application/xml");return OpenLayers.Request.issue(a)},PUT:function(a){a= OpenLayers.Util.extend(a,{method:"PUT"});a.headers=a.headers?a.headers:{};"CONTENT-TYPE"in OpenLayers.Util.upperCaseObject(a.headers)||(a.headers["Content-Type"]="application/xml");return OpenLayers.Request.issue(a)},DELETE:function(a){a=OpenLayers.Util.extend(a,{method:"DELETE"});return OpenLayers.Request.issue(a)},HEAD:function(a){a=OpenLayers.Util.extend(a,{method:"HEAD"});return OpenLayers.Request.issue(a)},OPTIONS:function(a){a=OpenLayers.Util.extend(a,{method:"OPTIONS"});return OpenLayers.Request.issue(a)}});(function(){function a(){this._object=f&&!k?new f:new window.ActiveXObject("Microsoft.XMLHTTP");this._listeners=[]}function b(){return new a}function c(a){b.onreadystatechange&&b.onreadystatechange.apply(a);a.dispatchEvent({type:"readystatechange",bubbles:!1,cancelable:!1,timeStamp:new Date+0})}function d(a){try{a.responseText=a._object.responseText}catch(b){}try{var c;var d=a._object,e=d.responseXML,f=d.responseText;h&&f&&e&&!e.documentElement&&d.getResponseHeader("Content-Type").match(/[^\/]+\/[^\+]+\+xml/)&& -(e=new window.ActiveXObject("Microsoft.XMLDOM"),e.async=!1,e.validateOnParse=!1,e.loadXML(f));c=e&&(h&&0!=e.parseError||!e.documentElement||e.documentElement&&"parsererror"==e.documentElement.tagName)?null:e;a.responseXML=c}catch(b){}try{a.status=a._object.status}catch(b){}try{a.statusText=a._object.statusText}catch(b){}}function e(a){a._object.onreadystatechange=new window.Function}var f=window.XMLHttpRequest,g=!!window.controllers,h=window.document.all&&!window.opera,k=h&&window.navigator.userAgent.match(/MSIE 7.0/); +(e=new window.ActiveXObject("Microsoft.XMLDOM"),e.async=!1,e.validateOnParse=!1,e.loadXML(f));c=e&&(h&&0!=e.parseError||!e.documentElement||e.documentElement&&"parsererror"==e.documentElement.tagName)?null:e;a.responseXML=c}catch(b){}try{a.status=a._object.status}catch(b){}try{a.statusText=a._object.statusText}catch(b){}}function e(a){a._object.onreadystatechange=null}var f=window.XMLHttpRequest,g=!!window.controllers,h=window.document.all&&!window.opera,k=h&&window.navigator.userAgent.match(/MSIE 7.0/); b.prototype=a.prototype;g&&f.wrapped&&(b.wrapped=f.wrapped);b.UNSENT=0;b.OPENED=1;b.HEADERS_RECEIVED=2;b.LOADING=3;b.DONE=4;b.prototype.readyState=b.UNSENT;b.prototype.responseText="";b.prototype.responseXML=null;b.prototype.status=0;b.prototype.statusText="";b.prototype.priority="NORMAL";b.prototype.onreadystatechange=null;b.onreadystatechange=null;b.onopen=null;b.onsend=null;b.onabort=null;b.prototype.open=function(a,f,k,q,n){delete this._headers;3>arguments.length&&(k=!0);this._async=k;var p=this, t=this.readyState,u;h&&k&&(u=function(){t!=b.DONE&&(e(p),p.abort())},window.attachEvent("onunload",u));b.onopen&&b.onopen.apply(this,arguments);4<arguments.length?this._object.open(a,f,k,q,n):3<arguments.length?this._object.open(a,f,k,q):this._object.open(a,f,k);this.readyState=b.OPENED;c(this);this._object.onreadystatechange=function(){if(!g||k)p.readyState=p._object.readyState,d(p),p._aborted?p.readyState=b.UNSENT:(p.readyState==b.DONE&&(delete p._data,e(p),h&&k&&window.detachEvent("onunload",u)), t!=p.readyState&&c(p),t=p.readyState)}};b.prototype.send=function(a){b.onsend&&b.onsend.apply(this,arguments);arguments.length||(a=null);a&&a.nodeType&&(a=window.XMLSerializer?(new window.XMLSerializer).serializeToString(a):a.xml,this._headers["Content-Type"]||this._object.setRequestHeader("Content-Type","application/xml"));this._data=a;a:if(this._object.send(this._data),g&&!this._async)for(this.readyState=b.OPENED,d(this);this.readyState<b.DONE;)if(this.readyState++,c(this),this._aborted)break a}; |