diff options
-rw-r--r-- | bin/export-norwegian-contacts | 97 | ||||
-rwxr-xr-x | bin/showcouncilrates | 73 | ||||
m--------- | commonlib | 0 | ||||
-rw-r--r-- | data/norway/contact-addresses.csv | 48 | ||||
-rw-r--r-- | perllib/FixMyStreet/App.pm | 2 | ||||
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Admin.pm | 2 | ||||
-rwxr-xr-x | templates/web/default/around/display_location.html | 4 | ||||
-rw-r--r-- | templates/web/default/report/new/fill_in_details.html | 4 | ||||
-rw-r--r-- | templates/web/southampton/header.html | 4 | ||||
-rw-r--r-- | web/js/map-OpenLayers.js | 12 | ||||
-rw-r--r-- | web/js/southampton.js | 15 |
11 files changed, 233 insertions, 28 deletions
diff --git a/bin/export-norwegian-contacts b/bin/export-norwegian-contacts new file mode 100644 index 000000000..8a7d438e5 --- /dev/null +++ b/bin/export-norwegian-contacts @@ -0,0 +1,97 @@ +#!/usr/bin/perl + +# export-norwegian-contacts: +# Export initial contact list from fiksgatami in a format usable by +# load-norwegian-contact. +# +# The format is +# ID;Name;email-address;Category1,Category2,... +# +# Based on script load-contacts copyright (c) 2006 UK Citizens Online +# Democracy and script load-norwegian-contacts copyright (c) 2011 +# Petter Reinholdtsen. +# Copyright 2011 Petter Reinholdtsen. +# +# $Id: load-norwegian-contacts,v 1.0 2007-08-02 11:44:59 matthew Exp $ + +use strict; +use warnings; +require 5.8.0; +use open OUT => ':utf8'; + +# Horrible boilerplate to set up appropriate library paths. +use FindBin; +use lib "$FindBin::Bin/../perllib"; +use lib "$FindBin::Bin/../commonlib/perllib"; + +use mySociety::Config; +use mySociety::DBHandle qw(dbh select_all); +use mySociety::MaPit; + +BEGIN { + mySociety::Config::set_file("$FindBin::Bin/../conf/general"); + mySociety::DBHandle::configure( + Name => mySociety::Config::get('BCI_DB_NAME'), + User => mySociety::Config::get('BCI_DB_USER'), + Password => mySociety::Config::get('BCI_DB_PASS'), + Host => mySociety::Config::get('BCI_DB_HOST', undef), + Port => mySociety::Config::get('BCI_DB_PORT', undef) + ); +} + +my $datafile = shift; + +open(my $fh, '>', $datafile) or die "Unable to write to $datafile"; + +# Categories used by more than half the areas is used as the default +# list. +my $sql = + "SELECT category FROM (SELECT category, COUNT(*) from contacts ". + " WHERE confirmed = 'true' AND deleted = 'false' ". + " GROUP BY category) as c ". + " WHERE count > (SELECT COUNT(*)/2 FROM contacts ". + " WHERE category = 'Annet') ". + " ORDER BY category"; +my $defcategoriesref = dbh()->selectcol_arrayref($sql); +print $fh "0000;default;;", join(',', @{$defcategoriesref}), "\n"; + +my %categorygroup; +$sql = "SELECT area_id, email, category FROM contacts ORDER BY category"; +my $contactref = dbh()->selectall_arrayref($sql, { Slice => {} }); +my @area_ids; +for my $row (@{$contactref}) { + my $key = $row->{area_id} .':'. $row->{email}; + push(@area_ids, $row->{area_id}); + if (exists $categorygroup{$key}) { + push(@{$categorygroup{$key}}, $row->{category}); + } else { + $categorygroup{$key} = [ $row->{category} ]; + } +} + +my $areas_info = mySociety::MaPit::call('areas', \@area_ids); + +my @list; +for my $key (keys %categorygroup) { + my ($area_id, $email) = split(/:/, $key); + my $categoriesref = $categorygroup{$key}; + my $areaname = $areas_info->{$area_id}->{name}; + my $areadigits = ($area_id < 100) ? 2 : 4; + if (identical_lists($defcategoriesref, $categoriesref)) { + push(@list,sprintf("%0${areadigits}d;%s;%s\n", + $area_id, $areaname, $email)); + } else { + push(@list, sprintf("%0${areadigits}d;%s;%s;%s\n", + $area_id, $areaname, $email, + join(',', @{$categoriesref}))); + } +} + +print $fh sort @list; + +sub identical_lists { + my ($a, $b) = @_; + return !(join(',', @{$a}) cmp join(',', @{$b})); +} + +exit 0; diff --git a/bin/showcouncilrates b/bin/showcouncilrates new file mode 100755 index 000000000..9ae5c3e7b --- /dev/null +++ b/bin/showcouncilrates @@ -0,0 +1,73 @@ +#!/usr/bin/perl + +use warnings; +use strict; + +use FindBin; +use lib "$FindBin::Bin/../perllib"; +use lib "$FindBin::Bin/../commonlib/perllib"; + +use POSIX qw(strcoll); +use mySociety::DBHandle qw(dbh); + +use mySociety::MaPit; +use FixMyStreet::Geocode::OSM; + +BEGIN { + mySociety::Config::set_file("$FindBin::Bin/../conf/general"); + mySociety::DBHandle::configure( + Name => mySociety::Config::get('BCI_DB_NAME'), + User => mySociety::Config::get('BCI_DB_USER'), + Password => mySociety::Config::get('BCI_DB_PASS'), + Host => mySociety::Config::get('BCI_DB_HOST', undef), + Port => mySociety::Config::get('BCI_DB_PORT', undef) + ); +} + +my $query = "SELECT council, COUNT(*) AS total, SUM(fixed) AS fixed + FROM (SELECT council, + CASE WHEN state = 'fixed' THEN 1 ELSE 0 END AS fixed + FROM problem WHERE confirmed IS NOT NULL AND + state IN ('fixed', 'confirmed') AND + whensent < NOW() - INTERVAL '4 weeks') AS a + GROUP BY council"; + +my $stats = dbh()->selectall_arrayref($query, { Slice => {} }); + +my @councils; +foreach my $row (@$stats) { + if ($row->{council}) { + $row->{council} =~ s/\|.*//g; + my @council_ids = split(/,/, $row->{council}); + push(@councils, @council_ids); + $row->{council} = \@council_ids; + } +} +my $areas_info = mySociety::MaPit::call('areas', \@councils); +my %adminsum; +my %adminfixed; +foreach my $row (@$stats){ + if ($row->{council}) { + for my $councilid (@{$row->{council}}) { + $adminsum{$councilid} += $row->{total}; + $adminfixed{$councilid} += $row->{fixed}; + } + } +} + +foreach my $councilid (sort sort_councils keys %adminsum) { + my $council = $areas_info->{$councilid}->{name}; + my $total = $adminsum{$councilid}; + my $fixed = $adminfixed{$councilid}; + printf("%5.1f %4d %s (%d)\n", 100 * $fixed / $total, $total, + $council, $councilid); +} + +sub sort_councils { + my $retval = ($adminfixed{$b} / $adminsum{$b}) <=> + ($adminfixed{$a} / $adminsum{$a}); + $retval = $adminsum{$b} <=> $adminsum{$a} unless $retval; + $retval = strcoll($areas_info->{$a}->{name}, + $areas_info->{$b}->{name}) unless $retval; + return $retval; +} diff --git a/commonlib b/commonlib -Subproject b332298ef86c673b48e6f55a73bdb0b8cf640ae +Subproject f2532c104a1268b536f79b13c52bdc0d7fb4d7a diff --git a/data/norway/contact-addresses.csv b/data/norway/contact-addresses.csv index 42fccc33c..05cd2df78 100644 --- a/data/norway/contact-addresses.csv +++ b/data/norway/contact-addresses.csv @@ -1,4 +1,4 @@ -# # i +# # 2010 engelsk kategori Forslag til oversettelse # --------------------------------------------------------------------- # 18k potholes Hull i vei @@ -65,7 +65,7 @@ # ------------------------------------- # Annet # -0000;default;;Hull i vei,Gater/Veier,Gatelys,Fortau/gangstier,Dumpet skrot,Forsøpling,Parkering,Graffiti/tagging,Trafikkskilter,Forlatte kjøretøy,Trær,Veinavn-skilter,Trafikklys,Park/landskap,Ulovlige oppslag,Buss- og togstopp,Offentlige toaletter,Vannforsyning,Snøbrøyting,Sykkelveier,Tette avløpsrister,Oljesøl,Annet +0000;default;;Annet,Buss- og togstopp,Dumpet skrot,Forlatte kjøretøy,Forsøpling,Fortau/gangstier,Gatefeiing,Gatelys,Gater/Veier,Graffiti/tagging,Hull i vei,Offentlige toaletter,Oljesøl,Parkering,Park/landskap,Snøbrøyting,Sykkelveier,Tette avløpsrister,Trafikklys,Trafikkskilter,Trær,Ulovlige oppslag,Universell utforming,Vannforsyning,Veinavn-skilter 0101;Halden;postmottak@halden.kommune.no 0104;Moss;post@moss.kommune.no 0105;Sarpsborg;postmottak@sarpsborg.com @@ -75,13 +75,13 @@ 0119;Marker;post@marker.kommune.no 0121;Rømskog;postmottak@romskog.kommune.no 0122;Trøgstad;postmottak@trogstad.kommune.no -0123;Spydeberg;post@spydeberg.kommune.no +0123;Spydeberg;servicetorget@spydeberg.kommune.no 0124;Askim;postmottak@askim.kommune.no 0125;Eidsberg;postmottak@eidsberg.kommune.no 0127;Skiptvet;postmottak@skiptvet.kommune.no 0128;Rakkestad;postmottak@rakkestad.kommune.no 0135;Råde;post@rade.kommune.no -0136;Rygge;postmottak@rygge.kommune.no +0136;Rygge;servicetorget@rygge.kommune.no 0137;Våler;postmottak@valer-of.kommune.no 0138;Hobøl;post@hobol.kommune.no 01;Østfold;sentralpost@ostfoldfk.no;Annet @@ -91,7 +91,7 @@ 0215;Frogn;postmottak@frogn.kommune.no 0216;Nesodden;postmottak@nesodden.kommune.no 0217;Oppegård;postmottak@oppegard.kommune.no -0219;Bærum;post@baerum.kommune.no +0219;Bærum;veiledningstorget@baerum.kommune.no;Annet,Buss- og togstopp,Dumpet skrot,Forlatte kjøretøy,Forsøpling,Fortau/gangstier,Gatefeiing,Gatelys,Gater/Veier,Graffiti/tagging,Hull i vei,Offentlige toaletter,Oljesøl,Parkering,Park/landskap,Snøbrøyting,Sykkelveier,Tette avløpsrister,Trafikklys,Trafikkskilter,Trær,Turveier,Ulovlige oppslag,Universell utforming,Vannforsyning,Veinavn-skilter 0220;Asker;post@asker.kommune.no 0221;Aurskog-Høland;postmottak@ahk.no 0226;Sørum;postmottak@sorum.kommune.no @@ -99,7 +99,7 @@ 0228;Rælingen;postmottak@ralingen.kommune.no 0229;Enebakk;postmottak@enebakk.kommune.no 0230;Lørenskog;postmottak@lorenskog.kommune.no -0231;Skedsmo;postmottak@skedsmo.kommune.no +0231;Skedsmo;ekspedts@skedsmo.kommune.no 0233;Nittedal;postmottak@nittedal.kommune.no 0234;Gjerdrum;postmottak@gjerdrum.kommune.no 0235;Ullensaker;postmottak@ullensaker.kommune.no @@ -109,7 +109,7 @@ 0239;Hurdal;postmottak@hurdal.kommune.no 02;Akershus;postmottak@akershus-fk.no;Annet 03;Oslo;postmottak@oslo.kommune.no -0402;Kongsvinger;postmottak@kongsvinger.kommune.no +0402;Kongsvinger;fiksgata@kongsvinger.kommune.no 0403;Hamar;postmottak@hamar.kommune.no 0412;Ringsaker;postmottak@ringsaker.kommune.no 0415;Løten;post@loten.kommune.no @@ -132,7 +132,7 @@ 0439;Folldal;postmottak@folldal.kommune.no 0441;Os;postmottak@os.kommune.no 04;Hedmark;postmottak@hedmark.org;Annet -0501;Lillehammer;postmottak@lillehammer.kommune.no +0501;Lillehammer;servicetorget@lillehammer.kommune.no 0502;Gjøvik;postmottak@gjovik.kommune.no 0511;Dovre;postmottak@dovre.kommune.no 0512;Lesja;postmottak@lesja.kommune.no @@ -162,7 +162,7 @@ 0602;Drammen;kommunepost@drammen.kommune.no 0604;Kongsberg;postmottak@kongsberg.kommune.no 0605;Ringerike;postmottak@ringerike.kommune.no -0612;Hole;postmottak@hole.kommune.no +0612;Hole;publikumskontoret@hole.kommune.no 0615;Flå;postmottak@flaa.kommune.no 0616;Nes;postmottak@nes-bu.kommune.no 0617;Gol;postmottak@gol.kommune.no @@ -237,7 +237,7 @@ 1004;Flekkefjord;post@flekkefjord.kommune.no 1014;Vennesla;post@vennesla.kommune.no 1017;Songdalen;postmottak@songdalen.kommune.no -1018;Søgne;postmottak@sogne.kommune.no +1018;Søgne;fiksgatami@sogne.kommune.no 1021;Marnardal;service@Marnardal.kommune.no 1026;Åseral;info@aseral.kommune.no 1027;Audnedal;info@audnedal.kommune.no @@ -247,6 +247,11 @@ 1037;Kvinesdal;post@kvinesdal.kommune.no 1046;Sirdal;post@sirdal.kommune.no 10;Vest-Agder;postmottak@vaf.no;Annet +11001;Statens vegvesen region øst;firmapost-ost@vegvesen.no;Fortau/gangstier,Gatefeiing,Gatelys,Gater/Veier,Hull i vei,Snøbrøyting,Sykkelveier,Trafikklys,Trafikkskilter,Veinavn-skilter +11002;Statens vegvesen region sør;firmapost-sor@vegvesen.no;Fortau/gangstier,Gatefeiing,Gatelys,Gater/Veier,Hull i vei,Snøbrøyting,Sykkelveier,Trafikklys,Trafikkskilter,Veinavn-skilter +11003;Statens vegvesen region vest;firmapost-vest@vegvesen.no;Fortau/gangstier,Gatefeiing,Gatelys,Gater/Veier,Hull i vei,Snøbrøyting,Sykkelveier,Trafikklys,Trafikkskilter,Veinavn-skilter +11004;Statens vegvesen region midt;firmapost-midt@vegvesen.no;Fortau/gangstier,Gatefeiing,Gatelys,Gater/Veier,Hull i vei,Snøbrøyting,Sykkelveier,Trafikklys,Trafikkskilter,Veinavn-skilter +11005;Statens vegvesen region nord;firmapost-nord@vegvesen.no;Fortau/gangstier,Gatefeiing,Gatelys,Gater/Veier,Hull i vei,Snøbrøyting,Sykkelveier,Trafikklys,Trafikkskilter,Veinavn-skilter 1101;Eigersund;post@eigersund.kommune.no 1102;Sandnes;postmottak@sandnes.kommune.no 1103;Stavanger;postmottak@stavanger.kommune.no @@ -274,20 +279,21 @@ 1151;Utsira;post@utsira.kommune.no 1160;Vindafjord;postmottak@vindafjord.kommune.no 11;Rogaland;firmapost@rogfk.no;Annet -1201;Bergen;postmottak@bergen.kommune.no +1201;Bergen;vaktsentral@bergen.kommune.no 1211;Etne;firmapost@etne.kommune.no 1216;Sveio;postmottak@sveio.kommune.no 1219;Bømlo;postmottak@bomlo.kommune.no -1221;Stord;post@stord.kommune.no +1221;Stord;kundetorget@stord.kommune.no;Annet,Buss- og togstopp,Dumpet skrot,Forlatte kjøretøy,Forsøpling,Fortau/gangstier,Gatefeiing,Gater/Veier,Graffiti/tagging,Hull i vei,Offentlige toaletter,Oljesøl,Parkering,Park/landskap,Snøbrøyting,Sykkelveier,Tette avløpsrister,Trafikklys,Trafikkskilter,Trær,Ulovlige oppslag,Universell utforming,Vannforsyning,Veinavn-skilter +1221;Stord;post@skl.as;Gatelys 1222;Fitjar;fitjar@fitjar.kommune.no 1223;Tysnes;post@tysnes.kommune.no 1224;Kvinnherad;post@kvinnherad.kommune.no 1227;Jondal;post@jondal.kommune.no -1228;Odda;epost@odda.kommune.no -1231;Ullensvang;postmottak@ullensvang.herad.no +1228;Odda;Tenestetorg@odda.kommune.no +1231;Ullensvang herad;postmottak@ullensvang.herad.no 1232;Eidfjord;postmottak@eidfjord.kommune.no -1233;Ulvik;postmottak@ulvik.kommune.no -1234;Granvin;postmottak@granvin.kommune.no +1233;Ulvik herad;postmottak@ulvik.kommune.no +1234;Granvin herad;postmottak@granvin.kommune.no 1235;Voss;postmottak@voss.kommune.no 1238;Kvam herad;postmottak@kvam.kommune.no 1241;Fusa;postkasse@fusa.kommune.no @@ -296,7 +302,7 @@ 1244;Austevoll;postmottak@austevoll.kommune.no 1245;Sund;postmottak@sund.kommune.no 1246;Fjell;postmottak@fjell.kommune.no -1247;Askøy;postmottak@askoy.kommune.no +1247;Askøy;kundetorg@askoy.kommune.no 1251;Vaksdal;post@vaksdal.kommune.no 1252;Modalen;postmottak@modalen.kommune.no 1253;Osterøy;post@osteroy.kommune.no @@ -308,7 +314,7 @@ 1265;Fedje;postmottak@fedje.kommune.no 1266;Masfjorden;post@masfjorden.kommune.no 12;Hordaland;hfk@post.hfk.no;Annet -1401;Flora;postmottak@flora.kommune.no +1401;Flora;tenestetorgetekspedisjon@flora.kommune.no 1411;Gulen;postmottak@gulen.kommune.no 1412;Solund;post@solund.kommune.no 1413;Hyllestad;postmottak@hyllestad.kommune.no @@ -325,7 +331,7 @@ 1429;Fjaler;post@fjaler.kommune.no 1430;Gaular;postmottak@gaular.kommune.no 1431;Jølster;postmottak@jolster.kommune.no -1432;Førde;postmottak@forde.kommune.no +1432;Førde;servicetorget@forde.kommune.no 1433;Naustdal;postmottak@naustdal.kommune.no 1438;Bremanger;post@bremanger.kommune.no 1439;Vågsøy;post@vagsoy.kommune.no @@ -336,7 +342,7 @@ 1449;Stryn;postmottak@stryn.kommune.no 14;Sogn og Fjordane;postmottak.sentraladm@sfj.no;Annet 1502;Molde;postmottak@molde.kommune.no -1504;Ålesund;postmottak@alesund.kommune.no +1504;Ålesund;servicetorget@alesund.kommune.no 1505;Kristiansund;postmottak@kristiansund.kommune.no 1511;Vanylven;postmottak@vanylven.kommune.no 1514;Sande;sande.kommune@sande-mr.kommune.no @@ -372,7 +378,7 @@ 1573;Smøla;postmottak@smola.kommune.no 1576;Aure;postmottak@aure.kommune.no 15;Møre og Romsdal;post@mrfylke.no;Annet -1601;Trondheim;postmottak@trondheim.kommune.no +1601;Trondheim;bydrift.vegdrift@trondheim.kommune.no 1612;Hemne;postmottak@hemne.kommune.no 1613;Snillfjord;postmottak@snillfjord.kommune.no 1617;Hitra;postmottak@hitra.kommune.no diff --git a/perllib/FixMyStreet/App.pm b/perllib/FixMyStreet/App.pm index 29d224268..68bfc728b 100644 --- a/perllib/FixMyStreet/App.pm +++ b/perllib/FixMyStreet/App.pm @@ -180,7 +180,7 @@ sub setup_request { Memcached::set_namespace( FixMyStreet->config('BCI_DB_NAME') . ":" ); - my $map = $host =~ /^osm\./ ? 'OSM' : $c->req->param('map'); + my $map = $host =~ /^osm\./ ? 'OSM' : $c->req->param('map_override'); #if ($c->sessionid) { # $map = $c->session->{map}; # $map = undef unless $map eq 'OSM'; diff --git a/perllib/FixMyStreet/App/Controller/Admin.pm b/perllib/FixMyStreet/App/Controller/Admin.pm index fbd50a973..3f2b62f6f 100644 --- a/perllib/FixMyStreet/App/Controller/Admin.pm +++ b/perllib/FixMyStreet/App/Controller/Admin.pm @@ -121,6 +121,7 @@ sub timeline : Path( 'timeline' ) : Args(0) { my %time; $c->model('DB')->schema->storage->sql_maker->quote_char( '"' ); + $c->model('DB')->schema->storage->sql_maker->name_sep( '.' ); my $probs = $c->cobrand->problems->timeline; @@ -427,6 +428,7 @@ sub search_reports : Path('search_reports') { # makes PostgreSQL unhappy elsewhere so we only want to do # it for this query and then switch it off afterwards. $c->model('DB')->schema->storage->sql_maker->quote_char( '"' ); + $c->model('DB')->schema->storage->sql_maker->name_sep( '.' ); my $problems = $c->cobrand->problems->search( { diff --git a/templates/web/default/around/display_location.html b/templates/web/default/around/display_location.html index ebea99895..395054645 100755 --- a/templates/web/default/around/display_location.html +++ b/templates/web/default/around/display_location.html @@ -36,7 +36,9 @@ %] <form action="[% c.uri_for('/report/new') %]" method="post" name="mapForm" id="mapForm"> -<input type="hidden" name="map" value="[% c.req.params.map | html %]"> +[% IF c.req.params.map_override %] +<input type="hidden" name="map_override" value="[% c.req.params.map_override | html %]"> +[% END %] <input type="hidden" name="pc" value="[% pc | html %]"> [% c.cobrand.form_elements('mapForm') %] diff --git a/templates/web/default/report/new/fill_in_details.html b/templates/web/default/report/new/fill_in_details.html index 32d4a733b..8150ba894 100644 --- a/templates/web/default/report/new/fill_in_details.html +++ b/templates/web/default/report/new/fill_in_details.html @@ -5,7 +5,9 @@ [% IF report.used_map %] <form action="[% c.uri_for('/report/new') %]" method="post" name="mapForm" id="mapForm"[% IF c.cobrand.allow_photo_upload %] enctype="multipart/form-data"[% END %]> -<input type="hidden" name="map" value="[% c.req.params.map | html %]"> +[% IF c.req.params.map_override %] +<input type="hidden" name="map_override" value="[% c.req.params.map_override | html %]"> +[% END %] <input type="hidden" name="pc" value="[% pc | html %]"> [% c.cobrand.form_elements('mapForm') %] [% ELSE %] diff --git a/templates/web/southampton/header.html b/templates/web/southampton/header.html index 7cd696618..5d94d5bdf 100644 --- a/templates/web/southampton/header.html +++ b/templates/web/southampton/header.html @@ -28,7 +28,7 @@ <form id="frmSearch" method="get" action="http://websearch.southampton.gov.uk/search"> <fieldset> <label for="searchbox">Search the site<br /></label> - <input class="text" type="text" value="Enter keywords" id="searchbox" name="q"/> + <input class="text" type="text" value="" placeholder="Enter keywords" id="searchbox" name="q"/> <input type="hidden" id="site" name="site" value="SouthamptonOnline"/> <input type="hidden" id="client" name="client" value="SouthamptonOnline"/> <input type="hidden" id="proxystylesheet" name="proxystylesheet" value="SouthamptonOnline"/> @@ -41,7 +41,7 @@ <label for="PostCode">Where I live <img class="moreInfo" src="/cobrands/southampton/information.gif" alt="Find information about where you live" title="Find information about where you live" /><br /> </label> - <input id="PostCode" name="Postcode" class="text2" type="text" value="Enter street/postcode" /> + <input id="PostCode" name="Postcode" class="text2" type="text" value="" placeholder="Enter street/postcode" /> <input class="button" type="submit" value="go" /> </fieldset> </form> diff --git a/web/js/map-OpenLayers.js b/web/js/map-OpenLayers.js index 6b4a03d7e..d00079517 100644 --- a/web/js/map-OpenLayers.js +++ b/web/js/map-OpenLayers.js @@ -41,6 +41,15 @@ $(function(){ return false; }); + // Vector layers must be added onload as IE sucks + if ($.browser.msie) { + $(window).load(fixmystreet_onload); + } else { + fixmystreet_onload(); + } +}); + +function fixmystreet_onload() { if ( fixmystreet.area ) { var area = new OpenLayers.Layer.Vector("KML", { strategies: [ new OpenLayers.Strategy.Fixed() ], @@ -96,8 +105,7 @@ $(function(){ var bounds = fixmystreet.markers.getDataExtent(); if (bounds) { fixmystreet.map.zoomToExtent( bounds ); } } - -}); +} function fms_markers_list(pins, transform) { var cols = { 'red':'R', 'green':'G', 'blue':'B', 'purple':'P' }; diff --git a/web/js/southampton.js b/web/js/southampton.js index da9552f05..1f3e16105 100644 --- a/web/js/southampton.js +++ b/web/js/southampton.js @@ -6,6 +6,21 @@ $(function(){ + $('[placeholder]').focus(function(){ + var input = $(this); + if (input.val() == input.attr('placeholder')) { + input.val(''); + input.removeClass('placeholder'); + input.css({ 'color': '#000000' }); + } + }).blur(function(){ + var input = $(this); + if (input.val() == '' || input.val() == input.attr('placeholder')) { + input.css({ 'color': '#999999' }); + input.val(input.attr('placeholder')); + } + }).blur(); + $('#form_category').change(function(){ var category = $(this).val(); if ('Potholes' == category) { |