diff options
author | Struan Donald <struan@exo.org.uk> | 2011-11-18 14:32:25 +0000 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2011-11-18 14:32:25 +0000 |
commit | 9a83d679abbdb467ec1c363d086b35f09a4c7044 (patch) | |
tree | 30c8fece41b518080fd420d33c2aaf742ddd6ea0 /web | |
parent | d941a8c26e943c941f8e37ecbd9a9982dd41cb70 (diff) | |
parent | 375610803cfcad104049ff895c77c53e6767e1e7 (diff) |
Merge remote branch 'origin/master' into js-validation
Diffstat (limited to 'web')
-rw-r--r-- | web/cobrands/reading/css/css.scss | 93 | ||||
-rw-r--r-- | web/cobrands/reading/css/print3rdParty.css | 33 | ||||
-rw-r--r-- | web/cobrands/reading/css/reading.css | 176 | ||||
-rwxr-xr-x | web/cobrands/reading/images/favicon.ico | bin | 0 -> 3262 bytes | |||
-rw-r--r-- | web/cobrands/reading/images/reading-borough-council-logo.gif | bin | 0 -> 4575 bytes | |||
-rw-r--r-- | web/css/_main.scss | 47 | ||||
-rw-r--r-- | web/css/core.scss | 8 | ||||
-rw-r--r-- | web/i/mysociety-on-white.gif | bin | 0 -> 1132 bytes | |||
-rw-r--r-- | web/i/promo-fb4tf.gif | bin | 0 -> 1213 bytes | |||
-rw-r--r-- | web/i/promo-icicles.gif | bin | 0 -> 2518 bytes | |||
-rw-r--r-- | web/js/OpenLayers.fixmystreet.js | 10 | ||||
-rw-r--r-- | web/js/fixmystreet.js | 21 | ||||
-rw-r--r-- | web/js/map-OpenLayers.js | 9 | ||||
-rw-r--r-- | web/js/map-bing-ol.js | 10 |
14 files changed, 392 insertions, 15 deletions
diff --git a/web/cobrands/reading/css/css.scss b/web/cobrands/reading/css/css.scss new file mode 100644 index 000000000..81ab69fd2 --- /dev/null +++ b/web/cobrands/reading/css/css.scss @@ -0,0 +1,93 @@ +// Generics + +$header_back: #ecf5fd; +$header_back_lighter: #ecf5fd; +$header_colour: #439DC2; +$header_darker: #ecf5fd; + +$map_width: 420px; + +@import "../../../css/_main.scss"; + +p.thirdParty#reading-logo { + margin-top: 0px; + padding-bottom: 0px; +} + +div#header { + border-bottom: solid 1px #CCC; +} + +#header a:link, #header a:visited, div#header { + background-color: transparent; +} + +a { + color: #9C2161; +} + +body { + font-family: Helvetica, Arial, sans-serif; + font-size: 13.5px; + color: black; +} + +#navigation { + margin-top: 8px; + a { + font-weight: bold; + } +} + +#mysociety { + + #map_box { + width: $map_width + 2; + } + + #map { + width: $map_width; + height: $map_width; + } + + dd { + margin-left: 40px; + } + + div { + padding-top: 0.2em; + padding-bottom: 0.2em; + } + + h3 { + font-size: 1.17em; + font-weight: bold; + margin: 1em 0em 1em 0em; + } + + h2 { + font-weight: bold; + margin: 1em 0em 1em 0em; + } + + ul, ol { + padding-left: 2em; + } + + label { + width: 6em; + } + + .fieldset div.checkbox, #problem_submit { + padding-left: 6.5em; + } + + table { + border-collapse: separate; + border-spacing: 1px; + } + + td { + padding: 3px; + } +} diff --git a/web/cobrands/reading/css/print3rdParty.css b/web/cobrands/reading/css/print3rdParty.css new file mode 100644 index 000000000..f5b7ebc83 --- /dev/null +++ b/web/cobrands/reading/css/print3rdParty.css @@ -0,0 +1,33 @@ +body { + background: white; + font-size: 12pt; + color:#000; + } +#access, +.header .social, .nav, .footer { + display: none; +} +.wrapper, #content { + width: auto; + margin: 0 2%; + padding: 0; + border: 0; + float: none !important; + color: black; + background: transparent none; +} +p#logo img.printMe { display:block; vertical-align: bottom; } +div#content { + margin-left: 5%; + padding-top: 1em; + border-top: 1px solid #9c2161; +} +p#logo { + margin-bottom: -8px; +} +a:link, a:visited { + color: #9c2161; + background: transparent; + font-weight: bold; + text-decoration: underline; +}
\ No newline at end of file diff --git a/web/cobrands/reading/css/reading.css b/web/cobrands/reading/css/reading.css new file mode 100644 index 000000000..4daef13c9 --- /dev/null +++ b/web/cobrands/reading/css/reading.css @@ -0,0 +1,176 @@ +html, body, div, span, object, iframe, +h1, h2, h3, h4, h5, h6, p, blockquote, pre, +abbr, address, cite, code, del, dfn, em, img, ins, kbd, q, samp, +small, strong, sub, sup, var, b, i, dl, dt, dd, ol, ul, li, +fieldset, form, label, legend, +table, caption, tbody, tfoot, thead, tr, th, td, +article, aside, canvas, details, figcaption, figure, +footer, header, hgroup, menu, nav, section, summary, +time, mark, audio, video { + margin: 0; + padding: 0; + border: 0; + font-size: 100%; + font: inherit; + vertical-align: baseline; +} +article, aside, details, figcaption, figure, +footer, header, hgroup, menu, nav, section { + display: block; +} +blockquote, q { quotes: none; } +blockquote:before, blockquote:after, +q:before, q:after { content: ''; content: none; } +ins { background-color: #ff9; color: #000; text-decoration: none; } +mark { background-color: #ff9; color: #000; font-style: italic; font-weight: bold; } +del { text-decoration: line-through; } +abbr[title], dfn[title] { border-bottom: 1px dotted; cursor: help; } +table { border-collapse: collapse; border-spacing: 0; } +hr { display: block; height: 1px; border: 0; border-top: 1px solid #ccc; margin: 1em 0; padding: 0; } +input, select { vertical-align: middle; } +body { font:13px/1.231 sans-serif; *font-size:small; } +select, input, textarea, button { font:99% sans-serif; } +pre, code, kbd, samp { font-family: monospace, sans-serif; } +html { overflow-y: scroll; } +a:hover, a:active { outline: none; } +ul, ol { margin-left: 0; } +ol { list-style-type: decimal; } +nav ul, nav li, +.nav ul, .nav li{ margin: 0; list-style:none; list-style-image: none; } +small { font-size: 85%; } +strong, th { font-weight: bold; } +td { vertical-align: top; } +sub, sup { font-size: 75%; line-height: 0; position: relative; } +sup { top: -0.5em; } +sub { bottom: -0.25em; } +pre { white-space: pre; white-space: pre-wrap; word-wrap: break-word; padding: 15px; } +textarea { overflow: auto; } +.ie6 legend, .ie7 legend { margin-left: -7px; } +input[type="radio"] { vertical-align: text-bottom; } +input[type="checkbox"] { vertical-align: bottom; } +.ie7 input[type="checkbox"] { vertical-align: baseline; } +.ie6 input { vertical-align: text-bottom; } +label, input[type="button"], input[type="submit"], input[type="image"], button { cursor: pointer; } +button, input, select, textarea { margin: 0; } +input:valid, textarea:valid { } +input:invalid, textarea:invalid { border-radius: 1px; -moz-box-shadow: 0px 0px 5px red; -webkit-box-shadow: 0px 0px 5px red; box-shadow: 0px 0px 5px red; } +.no-boxshadow input:invalid, .no-boxshadow textarea:invalid { background-color: #f0dddd; } +button { width: auto; overflow: visible; } +img { -ms-interpolation-mode: bicubic; } +body { + margin:0; + padding:0; + font:normal 14px Helvetica, Arial, serif; +} + + + +/*Main Structure*/ +.wrapper { + max-width: 1376px; + margin-bottom:20px; +} +header, nav, footer, +.header, .nav, .footer, +#content{ + margin:0 20px; +} + + +.header {} + +p#reading-logo{ + text-indent:-9999px; + background:url("/cobrands/reading/images/reading-borough-council-logo.gif") top left no-repeat; + width:176px; + padding-bottom:20px; +} +p.thirdParty#reading-logo { margin-top:35px;} +p#reading-logo img.printMe { display:none;} +p#reading-logo a{ + display:block; + height:38px; +} + +#content{ + margin-top:30px; +} +#content h1 { + font-weight: bold; + font-size:1.6em; + margin-bottom:1em; +} +.thirdParty { } +.thirdParty p { margin-bottom:1em;} + .footer .contact { + width:44%!important; + } + .footer .links { + width:55%!important; + margin-right:0!important; + } + .footer .links ul li { + display:inline; + font-size:12px; + margin-right:3px; + border-right:1px solid #999; + padding-right:4px; + } + .footer .links ul li.last { + margin-right:0; + border:none; + paddin-right:0; + } + .footer .partners { + width:100%!important; + } +footer, +.footer{ + margin-top:15px; +} +footer h3, +.footer h3{ + border-bottom:1px solid #b4b4b4; + padding-bottom:3px; + margin-bottom:10px; +} +footer p.title, +.footer p.title{ + border-bottom:1px solid #b4b4b4; + padding-bottom:3px; + margin-bottom:10px; +} +footer .contact, +.footer .contact { + width:38.9%; + margin-top:15px; +} +footer .links, +.footer .links { + width:15%; + margin-top:15px; +} +footer .partners, +.footer .partners { + width:44%; + margin-top:15px; +} +footer h4, +.footer h4 {display:inline;} +footer .contact, +footer .links, +.footer .contact, +.footer .links { + margin-right:1%; +} +footer .contact address, footer .contact .phone, +.footer .contact address, .footer .contact .phone{ + width:49%; +} +footer .contact,footer .links,footer .contact address,footer .contact .phone,footer .partners, +.footer .contact,.footer .links,.footer .contact address,.footer .contact .phone,.footer .partners{ + float:left; + font-style:normal +} +.clear { clear:both;} + diff --git a/web/cobrands/reading/images/favicon.ico b/web/cobrands/reading/images/favicon.ico Binary files differnew file mode 100755 index 000000000..2619d70e9 --- /dev/null +++ b/web/cobrands/reading/images/favicon.ico diff --git a/web/cobrands/reading/images/reading-borough-council-logo.gif b/web/cobrands/reading/images/reading-borough-council-logo.gif Binary files differnew file mode 100644 index 000000000..8532e63ea --- /dev/null +++ b/web/cobrands/reading/images/reading-borough-council-logo.gif diff --git a/web/css/_main.scss b/web/css/_main.scss index 383e099a1..305a9e43e 100644 --- a/web/css/_main.scss +++ b/web/css/_main.scss @@ -55,14 +55,6 @@ select, input, textarea { background-color: $header_back; } - p.promo { - border-top: 1px solid #bbb; - border-bottom: 1px solid #bbb; - background-color: #eee; - text-align: center; - padding: 0 0.5em; - } - } // Site layout @@ -106,7 +98,7 @@ select, input, textarea { #meta { list-style-type: none; - margin: 0.25em 0 0 1em; + margin: 30px 0 0.5em 1em; /* (was 0.25em 0 0 1em) forced to drop below promo (fix before the freeze) image */ padding: 0; font-size: 0.875em; li { @@ -164,6 +156,31 @@ select, input, textarea { background-position: 100% 0; } +#promo { + position: absolute; + top: 3.3em; + left: 10px; + a { + display: block; + padding:0; + border:2px solid white; + img { + margin:0px; + } + } + a:hover { + border:2px dotted #70CFE3; + } +} + +.promo-background { + margin-top:-4px; + background-image:url(/i/promo-icicles.gif); + background-repeat:repeat-x; + background-position:top left; + padding-top:3em; +} + #logo { border: none; position: absolute; @@ -211,6 +228,18 @@ select, input, textarea { #logo { display: none; } + #promo { + position: static; + width: 116px; + top: none; + text-align: center; + margin: 0.25em auto; + display:block; + } + .promo-background img#logo { + border:2px solid #fff; + background-color: #fff; + } #header { font-size: 150%; } diff --git a/web/css/core.scss b/web/css/core.scss index 0f98956de..03651b1e6 100644 --- a/web/css/core.scss +++ b/web/css/core.scss @@ -230,6 +230,14 @@ $map_width: 500px; margin-bottom: 1em; } + #category_meta { + margin-bottom: 30px; + } + + #category_meta label { + width: 10em; + } + // Map #map_box { diff --git a/web/i/mysociety-on-white.gif b/web/i/mysociety-on-white.gif Binary files differnew file mode 100644 index 000000000..0f8a10296 --- /dev/null +++ b/web/i/mysociety-on-white.gif diff --git a/web/i/promo-fb4tf.gif b/web/i/promo-fb4tf.gif Binary files differnew file mode 100644 index 000000000..d2d5ca1e0 --- /dev/null +++ b/web/i/promo-fb4tf.gif diff --git a/web/i/promo-icicles.gif b/web/i/promo-icicles.gif Binary files differnew file mode 100644 index 000000000..bac92fb17 --- /dev/null +++ b/web/i/promo-icicles.gif diff --git a/web/js/OpenLayers.fixmystreet.js b/web/js/OpenLayers.fixmystreet.js index 9616df8b6..eab691def 100644 --- a/web/js/OpenLayers.fixmystreet.js +++ b/web/js/OpenLayers.fixmystreet.js @@ -1100,7 +1100,15 @@ return true;} return false;},deactivate:function(){var deactivated=OpenLayers.Strategy.prototype.deactivate.call(this);if(deactivated){this.layer.events.un({"refresh":this.load,"visibilitychanged":this.load,scope:this});} return deactivated;},load:function(options){var layer=this.layer;layer.events.triggerEvent("loadstart");layer.protocol.read(OpenLayers.Util.applyDefaults({callback:OpenLayers.Function.bind(this.merge,this,layer.map.getProjectionObject()),filter:layer.filter},options));layer.events.un({"visibilitychanged":this.load,scope:this});},merge:function(mapProjection,resp){var layer=this.layer;layer.destroyFeatures();var features=resp.features;if(features&&features.length>0){if(!mapProjection.equals(layer.projection)){var geom;for(var i=0,len=features.length;i<len;++i){geom=features[i].geometry;if(geom){geom.transform(layer.projection,mapProjection);}}} layer.addFeatures(features);} -layer.events.triggerEvent("loadend");},CLASS_NAME:"OpenLayers.Strategy.Fixed"});OpenLayers.Date={toISOString:(function(){if("toISOString"in Date.prototype){return function(date){return date.toISOString();};}else{function pad(num,len){var str=num+"";while(str.length<len){str="0"+str;} +layer.events.triggerEvent("loadend");},CLASS_NAME:"OpenLayers.Strategy.Fixed"});OpenLayers.Handler.Pinch=OpenLayers.Class(OpenLayers.Handler,{started:false,stopDown:false,pinching:false,last:null,start:null,initialize:function(control,callbacks,options){OpenLayers.Handler.prototype.initialize.apply(this,arguments);},touchstart:function(evt){var propagate=true;this.pinching=false;if(OpenLayers.Event.isMultiTouch(evt)){this.started=true;this.last=this.start={distance:this.getDistance(evt.touches),delta:0,scale:1};this.callback("start",[evt,this.start]);propagate=!this.stopDown;}else{this.started=false;this.start=null;this.last=null;} +OpenLayers.Event.stop(evt);return propagate;},touchmove:function(evt){if(this.started&&OpenLayers.Event.isMultiTouch(evt)){this.pinching=true;var current=this.getPinchData(evt);this.callback("move",[evt,current]);this.last=current;OpenLayers.Event.stop(evt);} +return true;},touchend:function(evt){if(this.started){this.started=false;this.pinching=false;this.callback("done",[evt,this.start,this.last]);this.start=null;this.last=null;} +return true;},activate:function(){var activated=false;if(OpenLayers.Handler.prototype.activate.apply(this,arguments)){this.pinching=false;activated=true;} +return activated;},deactivate:function(){var deactivated=false;if(OpenLayers.Handler.prototype.deactivate.apply(this,arguments)){this.started=false;this.pinching=false;this.start=null;this.last=null;deactivated=true;} +return deactivated;},getDistance:function(touches){var t0=touches[0];var t1=touches[1];return Math.sqrt(Math.pow(t0.clientX-t1.clientX,2)+ +Math.pow(t0.clientY-t1.clientY,2));},getPinchData:function(evt){var distance=this.getDistance(evt.touches);var scale=distance/this.start.distance;return{distance:distance,delta:this.last.distance-distance,scale:scale};},CLASS_NAME:"OpenLayers.Handler.Pinch"});OpenLayers.Control.PinchZoom=OpenLayers.Class(OpenLayers.Control,{type:OpenLayers.Control.TYPE_TOOL,containerOrigin:null,pinchOrigin:null,currentCenter:null,autoActivate:true,initialize:function(options){OpenLayers.Control.prototype.initialize.apply(this,arguments);this.handler=new OpenLayers.Handler.Pinch(this,{start:this.pinchStart,move:this.pinchMove,done:this.pinchDone},this.handlerOptions);},activate:function(){var activated=OpenLayers.Control.prototype.activate.apply(this,arguments);if(activated){this.map.events.on({moveend:this.updateContainerOrigin,scope:this});this.updateContainerOrigin();} +return activated;},deactivate:function(){var deactivated=OpenLayers.Control.prototype.deactivate.apply(this,arguments);if(this.map&&this.map.events){this.map.events.un({moveend:this.updateContainerOrigin,scope:this});} +return deactivated;},updateContainerOrigin:function(){var container=this.map.layerContainerDiv;this.containerOrigin={x:parseInt(container.style.left,10),y:parseInt(container.style.top,10)};},pinchStart:function(evt,pinchData){this.pinchOrigin=evt.xy;this.currentCenter=evt.xy;},pinchMove:function(evt,pinchData){var scale=pinchData.scale;var containerOrigin=this.containerOrigin;var pinchOrigin=this.pinchOrigin;var current=evt.xy;var dx=Math.round((current.x-pinchOrigin.x)+(scale-1)*(containerOrigin.x-pinchOrigin.x));var dy=Math.round((current.y-pinchOrigin.y)+(scale-1)*(containerOrigin.y-pinchOrigin.y));this.applyTransform("translate("+dx+"px, "+dy+"px) scale("+scale+")");this.currentCenter=current;},applyTransform:function(transform){var style=this.map.layerContainerDiv.style;style['-webkit-transform']=transform;style['-moz-transform']=transform;},pinchDone:function(evt,start,last){this.applyTransform("");var zoom=this.map.getZoomForResolution(this.map.getResolution()/last.scale,true);if(zoom!==this.map.getZoom()||!this.currentCenter.equals(this.pinchOrigin)){var resolution=this.map.getResolutionForZoom(zoom);var location=this.map.getLonLatFromPixel(this.pinchOrigin);var zoomPixel=this.currentCenter;var size=this.map.getSize();location.lon+=resolution*((size.w/2)-zoomPixel.x);location.lat-=resolution*((size.h/2)-zoomPixel.y);this.map.setCenter(location,zoom);}},CLASS_NAME:"OpenLayers.Control.PinchZoom"});OpenLayers.Date={toISOString:(function(){if("toISOString"in Date.prototype){return function(date){return date.toISOString();};}else{function pad(num,len){var str=num+"";while(str.length<len){str="0"+str;} return str;} return function(date){var str;if(isNaN(date.getTime())){str="Invalid Date";}else{str=date.getUTCFullYear()+"-"+ pad(date.getUTCMonth()+1,2)+"-"+ diff --git a/web/js/fixmystreet.js b/web/js/fixmystreet.js index 291e096f8..3bf30d9a6 100644 --- a/web/js/fixmystreet.js +++ b/web/js/fixmystreet.js @@ -3,6 +3,24 @@ * FixMyStreet JavaScript */ +function form_category_onchange() { + $.getJSON('/report/new/category_extras', { + latitude: fixmystreet.latitude, + longitude: fixmystreet.longitude, + category: this.options[ this.selectedIndex ].text, + }, function(data) { + if ( data.category_extra ) { + if ( $('#category_meta').size() ) { + $('#category_meta').html( data.category_extra); + } else { + $('#form_category_row').after( data.category_extra ); + } + } else { + $('#category_meta').empty(); + } + }); +} + $(function(){ $('html').removeClass('no-js').addClass('js'); @@ -123,6 +141,9 @@ $(function(){ timer = window.setTimeout(email_alert_close, 2000); }); + + $('#form_category').change( form_category_onchange ); + // Geolocation if (geo_position_js.init()) { $('#postcodeForm').append('<p id="geolocate_para">Or <a href="#" id="geolocate_link">locate me automatically</a>').css({ "padding-bottom": "0.5em" }); diff --git a/web/js/map-OpenLayers.js b/web/js/map-OpenLayers.js index 0f9974222..b911b7c71 100644 --- a/web/js/map-OpenLayers.js +++ b/web/js/map-OpenLayers.js @@ -144,9 +144,9 @@ function fixmystreet_onload() { $('#all_pins_link').click(function(e) { e.preventDefault(); fixmystreet.markers.setVisibility(true); - var welsh = 0; var texts = [ 'en', 'Include stale reports', 'Hide stale reports', + 'nb', 'Inkluder utdaterte problemer', 'Skjul utdaterte rapporter', 'cy', 'Cynnwys hen adroddiadau', 'Cuddio hen adroddiadau' ]; for (var i=0; i<texts.length; i+=3) { @@ -164,6 +164,8 @@ function fixmystreet_onload() { } if (lang == 'cy') { document.getElementById('hide_pins_link').innerHTML = 'Cuddio pinnau'; + } else if (lang == 'nb') { + document.getElementById('hide_pins_link').innerHTML = 'Gjem nĂ¥ler'; } else { document.getElementById('hide_pins_link').innerHTML = 'Hide pins'; } @@ -315,6 +317,11 @@ OpenLayers.Control.Click = OpenLayers.Class(OpenLayers.Control, { }, function(data) { $('#councils_text').html(data.councils_text); $('#form_category_row').html(data.category); + /* Need to reset this here as it gets removed when we replace + the HTML for the dropdown */ + if ( data.has_open311 > 0 ) { + $('#form_category').change( form_category_onchange ); + } }); $('#side-form').show(); $('#side').hide(); diff --git a/web/js/map-bing-ol.js b/web/js/map-bing-ol.js index 391f837c6..9f8dc9599 100644 --- a/web/js/map-bing-ol.js +++ b/web/js/map-bing-ol.js @@ -88,11 +88,13 @@ OpenLayers.Layer.Bing = OpenLayers.Class(OpenLayers.Layer.XYZ, { "http://c.tilma.mysociety.org/sv/${z}/${x}/${y}.png" ]; } else { + var type = ''; + if (z > 10) type = '&productSet=mmOS'; var url = [ - "http://ecn.t0.tiles.virtualearth.net/tiles/r${id}.png?g=701&productSet=mmOS", - "http://ecn.t1.tiles.virtualearth.net/tiles/r${id}.png?g=701&productSet=mmOS", - "http://ecn.t2.tiles.virtualearth.net/tiles/r${id}.png?g=701&productSet=mmOS", - "http://ecn.t3.tiles.virtualearth.net/tiles/r${id}.png?g=701&productSet=mmOS" + "http://ecn.t0.tiles.virtualearth.net/tiles/r${id}.png?g=701" + type, + "http://ecn.t1.tiles.virtualearth.net/tiles/r${id}.png?g=701" + type, + "http://ecn.t2.tiles.virtualearth.net/tiles/r${id}.png?g=701" + type, + "http://ecn.t3.tiles.virtualearth.net/tiles/r${id}.png?g=701" + type, ]; } var s = '' + x + y + z; |