diff options
Diffstat (limited to 'web')
46 files changed, 1195 insertions, 402 deletions
diff --git a/web/cobrands/barnet/_colours.scss b/web/cobrands/barnet/_colours.scss new file mode 100644 index 000000000..2f5ccc42b --- /dev/null +++ b/web/cobrands/barnet/_colours.scss @@ -0,0 +1,9 @@ +/* COLOURS */ + +$primary: #E9E9EA; +$primary_b: #000000; +$primary_text: #3E3D44; + +$contrast1: #E1E3E4; +$contrast1_dark: darken(#E1E3E4, 10%); +$contrast2: #AA8D11; diff --git a/web/cobrands/barnet/barnet.scss b/web/cobrands/barnet/barnet.scss new file mode 100644 index 000000000..a6feb018f --- /dev/null +++ b/web/cobrands/barnet/barnet.scss @@ -0,0 +1,115 @@ +/* Parts of barnet's main CSS needed for its header/footer and adjusted (see + * bottom) to not be affected by main FixMyStreet CSS. Not very sustainable; + * perhaps we should wrap all council CSS within a SCSS #council ID? Hmm. + */ + +@import "compass"; + +#column_nav li { list-style: none ;} + +#content ol.big-numbers li { + padding: 0 0 0 2.5em; +} + +#barnet-wrapper { + width: 100%; + display: table; + caption-side: bottom; +} + +#barnet-powered-by { + clear: both; +} + +body {font-size: 75%; font-family: Arial, Helvetica, sans-serif; color: #3e3d44; padding: 0; margin: 0; line-height: 1.5; background: #e9e9ea;} +body > html {font-size: 12px;} + +#barnet-wrapper {padding: 0; margin: 20px auto; width: 960px; background: #fff;} +#ie_wrapper {display: block; padding: 20px 25px 25px;} +#page {float: left; width: 100%;} + +#mast {clear: both;} + +#mast .pseudoH1 {margin: 0 0 0 -3px; padding: 0; background: url(img/barnet-logo.gif) no-repeat top left; width: 240px; height: 38px; float: left;} +#mast .pseudoH1 a, #mast .pseudoH1 a:link, #mast .pseudoH1 a:visited, #mast .pseudoH1 a:hover, #mast .pseudoH1 a:active {display: block; width: 240px; height: 38px; padding: 0; background: url(img/barnet-logo.gif) no-repeat top left;} +#mast .pseudoH1 span {position: absolute; margin-top: -13000px; top: -13000px;} + +#mast .mast_links {float: right; display: inline; margin: 0; padding: 10px 0 0; list-style: none; overflow: hidden;} + +#mast #search {clear: both; float: right; margin: 8px 0 0; background: #e1e3e4; border-top: 6px solid #bddadc; border-bottom: 2px solid #c8cacb; width: 100%; padding: 3px 0 2px; height: 21px;} + +/* ############################################################## */ + +#content {margin: 0; width: 910px; overflow: hidden; min-height: 350px;} +#content.withWidth {margin: 0 0 0 232px; width: 446px; overflow: hidden; float: left; display: inline;} +#content.fullWidth {width: 678px;} +#content.home {margin-top: 18px;} + +.mappage { + #content.withWidth {margin: 0 0 0 0px; width: auto; overflow: hidden; float: left; display: inline;} + #content.fullWidth {width: 900px;} +} + +/* IE6 ignore the second #foo.bar rule so we have to fudge it another way */ +.ie6 { + .mappage { + #content { + margin: 0 0 0 0px; + overflow: hidden; + float: left; + display: inline; + width: 900px; + } + } +} + +#breadcrumb {font-size: .9em; color: #5c6267; padding: 6px 0; margin: 0 0 0 232px;} +#breadcrumb.full {margin: 0;} +#breadcrumb ul {margin: 0; padding: 0; list-style: none;} +#breadcrumb ul li {margin: 0; padding: 0 4px 0 0; display: inline;} +#breadcrumb ul li a:link, #breadcrumb ul li a:visited, #breadcrumb ul li a:hover, #breadcrumb ul li a:active {color: #5c6267; background: url(img/bcArrow.gif) no-repeat right center; padding: 0 10px 0 0; font-weight: normal;} +#breadcrumb ul li span {font-weight: normal; color: #5c6267;} + +/* ############################################################## */ + +#column_nav {width: 214px; float: left; display: inline; padding: 0; margin: -35px 0 0 -910px; border-right: 3px solid #fff;} + +.ie6 #column_nav { + float: none; + position: absolute; + top: 85px; + margin: 0 0 0 0px; +} + +body.mappage #column_nav { display: none; } + +#content h1 {margin: 0 0 20px; font-size: 1.8em; border-bottom: 6px solid #bed9dd; font-family: Georgia, Times, 'Times New Roman', serif; color: #5d6167;} +#content h1 span {padding: 6px 7px 3px; border: 1px solid #eff1f2; border-bottom: 0 none; display: block;} +#content h1#reports_heading span { display: none; } + +#column_nav .navigation {background: #fff; margin: 0 0 4px;} +#column_nav h2 {font-size: 1.2em; padding: 0; height: 29px; margin: 0; border-radius: 0 0 3px 3px; background: url(img/nav-bg-active.gif) left bottom repeat-x; border-top: 6px solid #bddadc;} +#column_nav #nav1 h2 {border-radius: 0 0 0 3px;} +#column_nav h2 a {color: #fff; padding: 3px 10px 0 26px; display: block; background: url(img/nav-arrow.gif) 8px 7px no-repeat;} +#column_nav .active h2 a {background: url(img/nav-arrow-active.gif) 8px 8px no-repeat;} +#column_nav ul {margin: 0 0 0 4px; padding: 8px 7px 4px; border-width: 0 1px 1px; border-color: #e1e1e1; border-style: solid; border-radius: 3px; list-style: none; background: #fff; background: -moz-linear-gradient(top, #ffffff 0%, #f7f9f8 100%); background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ffffff), color-stop(100%,#f7f9f8)); background: -webkit-linear-gradient(top, #ffffff 0%,#f7f9f8 100%); background: -o-linear-gradient(top, #ffffff 0%,#f7f9f8 100%); background: -ms-linear-gradient(top, #ffffff 0%,#f7f9f8 100%); background: linear-gradient(top, #ffffff 0%,#f7f9f8 100%); filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#f7f9f8',GradientType=0);} +#column_nav ul li {margin: 0; padding: 2px 4px; border-bottom: 1px solid #bfc0c1; color: #333; font-size: .9em;} +#column_nav ul li.lastItem {border-bottom: none;} +#column_nav ul li a:link, #column_nav ul li a:visited, #column_nav ul li a:hover, #column_nav ul li a:active {display: block; color: #333; font-weight: normal;} +#column_nav ul li a:hover, #column_nav ul li a:active {text-decoration: none; color: #0090a2;} + +/* ############################################################## */ + +#footer {clear: both; margin: 10px 0 0; padding: 15px 0 0; text-align: left;} +#footer p {border-top: 1px solid #dadadb; border-bottom: 1px solid #dadadb; margin: 0 0 5px; color: #5d6167; float: left; display: inline; height: 24px; padding: 8px 0 2px; width: 551px;} +#footer p a {color: #5d6167; font-weight: normal; padding: 0 2px;} +#footer p.assocLinks {float: right; display: inline; padding: 5px 0; width: 359px;} +#footer p.assocLinks a {float: left; display: inline; margin: 0 0 0 8px; padding: 0; background-position: center top; background-repeat: no-repeat; width: 24px; height: 24px;} +#footer p.assocLinks a:active, #footer p.assocLinks a:hover, #footer p.assocLinks a:focus {background-position: center bottom;} +#footer a#goto_browsealoud {background-image: url(img/browsealoud.gif); width: 95px; height: 25px; margin-top: 1px;} +#footer a#goto_directgov {background-image: url(img/directgov.gif); width: 90px; margin: 0 0 0 22px;} +#footer a#share_facebook {background-image: url(img/social1-facebook.gif); margin: 0 0 0 24px;} +#footer a#share_twitter {background-image: url(img/social2-twitter.gif);} +#footer a#share_youtube {background-image: url(img/social3-youtube.gif);} +#footer a#share_flickr {background-image: url(img/social4-flickr.gif);} +#bottomBar {background: url(img/barnet-footer-logo.gif) 771px 12px no-repeat #21aaaa; display: block; width: 100%; height: 56px; border-top: 6px solid #bddadc;} diff --git a/web/cobrands/barnet/base.scss b/web/cobrands/barnet/base.scss new file mode 100644 index 000000000..0447c6779 --- /dev/null +++ b/web/cobrands/barnet/base.scss @@ -0,0 +1,39 @@ +@import "../fixmystreet/_h5bp"; +@import "./_colours"; +@import "../fixmystreet/_mixins"; +@import "compass"; + +@import "../fixmystreet/_base"; + +#mast, +#breadcrumb, +#page-title, +#column_nav, +#footer, +#bottomBar +{ display: none } + +#site-header{ + @include background(none); + background-color: white; +} +#site-logo { + width: 235px; + background: url('/cobrands/barnet/img/barnet-logo.gif') -3px -3px no-repeat; +} +#nav-link { + right: 1em; + background: url('/cobrands/barnet/img/barnet-skipnav.png') no-repeat; +} + +#front-main #postcodeForm div input#submit, +.green-btn, +button.green-btn, +input.green-btn, +.red-btn, +button.red-btn, +input.red-btn{ + @include button-reset; + background: #5D6167; + color: white; +} diff --git a/web/cobrands/barnet/config.rb b/web/cobrands/barnet/config.rb new file mode 100644 index 000000000..cab97b18f --- /dev/null +++ b/web/cobrands/barnet/config.rb @@ -0,0 +1,25 @@ +# Require any additional compass plugins here. + +# Set this to the root of your project when deployed: +http_path = "/" +css_dir = "" +sass_dir = "" +images_dir = "" +javascripts_dir = "" + +# You can select your preferred output style here (can be overridden via the command line): +# output_style = :expanded or :nested or :compact or :compressed + +# To enable relative paths to assets via compass helper functions. Uncomment: +# relative_assets = true + +# To disable debugging comments that display the original location of your selectors. Uncomment: +# line_comments = false + +# If you prefer the indented syntax, you might want to regenerate this +# project again passing --syntax sass, or you can uncomment this: +# preferred_syntax = :sass +# and then run: +# sass-convert -R --from scss --to sass sass scss && rm -rf sass && mv scss sass + +line_comments = false # by Compass.app diff --git a/web/cobrands/barnet/img/barnet-footer-logo.gif b/web/cobrands/barnet/img/barnet-footer-logo.gif Binary files differnew file mode 100644 index 000000000..afba1cca2 --- /dev/null +++ b/web/cobrands/barnet/img/barnet-footer-logo.gif diff --git a/web/cobrands/barnet/img/barnet-logo.gif b/web/cobrands/barnet/img/barnet-logo.gif Binary files differnew file mode 100644 index 000000000..86e0f4ee8 --- /dev/null +++ b/web/cobrands/barnet/img/barnet-logo.gif diff --git a/web/cobrands/barnet/img/barnet-skipnav.png b/web/cobrands/barnet/img/barnet-skipnav.png Binary files differnew file mode 100644 index 000000000..21efe0f67 --- /dev/null +++ b/web/cobrands/barnet/img/barnet-skipnav.png diff --git a/web/cobrands/barnet/img/bcArrow.gif b/web/cobrands/barnet/img/bcArrow.gif Binary files differnew file mode 100644 index 000000000..4e7c1848e --- /dev/null +++ b/web/cobrands/barnet/img/bcArrow.gif diff --git a/web/cobrands/barnet/img/browsealoud.gif b/web/cobrands/barnet/img/browsealoud.gif Binary files differnew file mode 100644 index 000000000..4fbb3eded --- /dev/null +++ b/web/cobrands/barnet/img/browsealoud.gif diff --git a/web/cobrands/barnet/img/directgov.gif b/web/cobrands/barnet/img/directgov.gif Binary files differnew file mode 100644 index 000000000..1c9dd22e2 --- /dev/null +++ b/web/cobrands/barnet/img/directgov.gif diff --git a/web/cobrands/barnet/img/fms-logo.png b/web/cobrands/barnet/img/fms-logo.png Binary files differnew file mode 100644 index 000000000..23bea6b0f --- /dev/null +++ b/web/cobrands/barnet/img/fms-logo.png diff --git a/web/cobrands/barnet/img/nav-arrow-active.gif b/web/cobrands/barnet/img/nav-arrow-active.gif Binary files differnew file mode 100644 index 000000000..89ff9d0b3 --- /dev/null +++ b/web/cobrands/barnet/img/nav-arrow-active.gif diff --git a/web/cobrands/barnet/img/nav-bg-active.gif b/web/cobrands/barnet/img/nav-bg-active.gif Binary files differnew file mode 100644 index 000000000..0d2ec9873 --- /dev/null +++ b/web/cobrands/barnet/img/nav-bg-active.gif diff --git a/web/cobrands/barnet/img/social1-facebook.gif b/web/cobrands/barnet/img/social1-facebook.gif Binary files differnew file mode 100644 index 000000000..41b404df0 --- /dev/null +++ b/web/cobrands/barnet/img/social1-facebook.gif diff --git a/web/cobrands/barnet/img/social2-twitter.gif b/web/cobrands/barnet/img/social2-twitter.gif Binary files differnew file mode 100644 index 000000000..17f368536 --- /dev/null +++ b/web/cobrands/barnet/img/social2-twitter.gif diff --git a/web/cobrands/barnet/img/social3-youtube.gif b/web/cobrands/barnet/img/social3-youtube.gif Binary files differnew file mode 100644 index 000000000..eeb6ba356 --- /dev/null +++ b/web/cobrands/barnet/img/social3-youtube.gif diff --git a/web/cobrands/barnet/img/social4-flickr.gif b/web/cobrands/barnet/img/social4-flickr.gif Binary files differnew file mode 100644 index 000000000..300e75da0 --- /dev/null +++ b/web/cobrands/barnet/img/social4-flickr.gif diff --git a/web/cobrands/barnet/layout.scss b/web/cobrands/barnet/layout.scss new file mode 100644 index 000000000..97b27cfff --- /dev/null +++ b/web/cobrands/barnet/layout.scss @@ -0,0 +1,260 @@ +@import "_colours"; +@import "../fixmystreet/_layout"; + +#mast, +#breadcrumb, +#page-title, +#column_nav, +#footer, +#bottomBar { + display: block; +} + +// So that map appears underneath the header +.wrapper { + position: relative; +} +.ie6, .ie7 { + .wrapper { + padding-top: 1em; + } +} + +#front-main { + background: $primary; + @include border-radius(1em 1em 0 0); + margin-bottom: 1em; + padding-top: 0; + width: 678px; + // layout sets this because base has it slightly lighter + h2 { + color: $primary_text; + } + #front-main-container { + padding: 1em; + } +} + +#front_intro { + float: left; + margin-right: 3em; +} + +#front_recent { + margin-left: 3em; +} + +body.fullwidthpage { + .content { + width: 52em; + } +} +.ie6 { + body.fullwidthpage { + #front-main { + margin-top: -4em; + } + #front-howto, + #front-recently { + width: 26em; + } + .container { + padding: 0; + } + .content { + margin-left: 0px; + width: 55em; + } + div.img { + margin-top: -3.3em; + } + } +} + +body.twothirdswidthpage { + .content { + @include box-shadow(none); + width: 640px; + margin-top: 0; + .sticky-sidebar { + display: none; + aside { + top: 25em; + } + } + } +} + +.nav-wrapper { + display: none; +} + +.mappage { + #breadcrumb { + margin-left: 0px; + } +} + +.frontpage .content { + margin: 0; + @include box-shadow(none); +} +.ie6, .ie7, .ie8 { + .frontpage .content { + border: none; + } +} + +#content .container h1 { + border-bottom: none; + font-size: 2em; + margin-bottom: 0.5em; +} + +.shadow-wrap { + position: static; + padding-top: 0; + margin-bottom: 1em; + ul#key-tools { + border-top: none; + border-bottom: 1px solid $primary; + li { + a.chevron { + background-position: right -3230px; + } + a.feed { + background-position: right -3080px; + } + a.abuse { + background-position: right -2940px; + } + } + } + ul#key-tools.singleton { + li a { + padding-right: 4em; + } + } +} + +#content h1.big-green-banner { + font-size: 1.4em; + margin-left: -2em; + background: #e1e3e4 url(/cobrands/fixmystreet/images/sprite.png) right -2192px no-repeat +} + +body.frontpage { + #user-meta { + p { + top: 1em; + color: $primary_text; + a { + background: none; + } + } + } +} +#user-meta { + float: right; + p { + @include box-shadow(none); + color: $primary_text; + position: relative; + background: none; + a { + color: $primary_text; + background: none; + } + a:hover { + background: $primary; + } + } +} +.ie6 { + #user-meta { + float: none; + p { + position: absolute; + margin-top: 35px; + margin-right: 20px; + right: 0px; + left: auto; + } + + } + .mappage { + #user-meta { + p { + margin-right: -100px; + } + } + } +} + +/* barnet styles */ + +.clear { + clear: both; +} + +.container { + padding: 0 1em; +} + +#site-header, +#site-logo { + display: none !important; +} + + +#report-a-problem-sidebar { + left: 30em; + top: 4em; + width: 17em; + .sidebar-tips, + .sidebar-notes { + font-size: 0.9em; + } +} +.ie6 { + #report-a-problem-sidebar { + margin-top: -4em; + left: 30em; + .sidebar-notes { + padding-bottom: 0.5em; + } + p { + margin-bottom: 0.4em; + } + } +} + + +.general-sidebar-notes { + left: 25em; + width: 14em; + font-size: 1.2em; + p { + margin-bottom: 0 !important; + } +} + +#front-howto #front_stats div big, +ol.big-numbers > li::before { + color: #C0E8E8; +} + +.banner { + p { + top: -2em; + } + p#fixed { + padding-top: 4em; + background: #00BD08; + } +} + + +#map_box { + border: 1px solid black; +} diff --git a/web/cobrands/barnet/position_map.js b/web/cobrands/barnet/position_map.js new file mode 100644 index 000000000..465d852ec --- /dev/null +++ b/web/cobrands/barnet/position_map.js @@ -0,0 +1,25 @@ +function position_map_box() { + var map_pos = 'absolute', map_height = $('.wrapper').height(); + // on the all reports page the height of the wrapper leads to a very + // large map so we set a maximum size + if ( map_height > 600 ) { + map_height = 600; + } + $('#map_box').prependTo('.wrapper').css({ + zIndex: 0, position: map_pos, + top: 1, left: $('.wrapper').left, + right: 0, bottom: $('.wrapper').bottom + 1, + width: '898px', height: map_height, + margin: 0 + }); +} + +function map_fix() { + var height = $('.wrapper').height() - 3; + if ( height > 600 ) { + height = 600; + } + $('#map_box').height(height); +} + +var slide_wards_down = 1; diff --git a/web/cobrands/bromley/_colours.scss b/web/cobrands/bromley/_colours.scss index c0376274e..e178c9db2 100644 --- a/web/cobrands/bromley/_colours.scss +++ b/web/cobrands/bromley/_colours.scss @@ -1,8 +1,9 @@ /* COLOURS */ -$primary: rgb(76,120,168); +$primary: rgb(91,120,147); $primary_b: #000000; $primary_text: #ffffff; -$contrast1: #00BD08; +$contrast1: rgb(91,120,147); +$contrast1_dark: darken(rgb(91,120,147), 10%); $contrast2: #AA8D11; diff --git a/web/cobrands/bromley/base.scss b/web/cobrands/bromley/base.scss index 4594f832f..9c5ff2b0f 100644 --- a/web/cobrands/bromley/base.scss +++ b/web/cobrands/bromley/base.scss @@ -5,3 +5,56 @@ @import "../fixmystreet/_base"; +a, a:visited { + color: #369; + &:hover, &:active { + color: #369; + } +} + +h1.main { + color: $primary; + text-align: center; + margin: 0.5em 0; +} + +// Want a white header, and logo is slightly bigger +#site-header { + @include background(linear-gradient(#ddd, #fff 10%, #fff)); + height: 4em; +} + +// Colour tab to match colour scheme +#nav-link { + width: 50px; + height: 48px; + background: url('/cobrands/bromley/tab-blue.png') 0 0 no-repeat; +} + +// Change logo to logo of council +#site-logo { + display: block; + width: 80px; + height: 44px; + top: 0.9em; + background: url('/cobrands/bromley/bromley-logo.s.jpg') 0 0 no-repeat; +} + +#problems-nav { + border-bottom:0.25em solid $primary; + ul li a { + text-transform: none; + &.active { + background: $primary; + color: #fff; + } + } +} + +.big-green-banner { + text-transform: none; +} + +#form_sign_in { + margin-top: 1em; +} diff --git a/web/cobrands/bromley/bromley-logo.jpg b/web/cobrands/bromley/bromley-logo.jpg Binary files differnew file mode 100644 index 000000000..28da8b7ea --- /dev/null +++ b/web/cobrands/bromley/bromley-logo.jpg diff --git a/web/cobrands/bromley/bromley-logo.s.jpg b/web/cobrands/bromley/bromley-logo.s.jpg Binary files differnew file mode 100644 index 000000000..16f632848 --- /dev/null +++ b/web/cobrands/bromley/bromley-logo.s.jpg diff --git a/web/cobrands/bromley/bromley.scss b/web/cobrands/bromley/bromley.scss new file mode 100644 index 000000000..91ec75fea --- /dev/null +++ b/web/cobrands/bromley/bromley.scss @@ -0,0 +1,110 @@ +/* Parts of Bromley's main CSS needed for its header/footer and adjusted (see + * bottom) to not be affected by main FixMyStreet CSS. Not very sustainable; + * perhaps we should wrap all council CSS within a SCSS #council ID? Hmm. + */ + +@import "compass"; + +// Bits of Bromley's forms.css, adjusted +input[type=text], +input[type=password], +input[type=email], +input[type=file], +textarea, +select { background: #fff; border: 1px solid #768b9a; border-color: #768b9a #d1dee8 #d1dee8 #768b9a; color: #333; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; padding: 8px; +@include border-radius(0); } + +.green-btn, button.green-btn, input.green-btn { + background: #5b7189 url("https://www.bromley.gov.uk/site/styles/css_img/button.gif") repeat-x 0 -1px; border: 1px solid #8e9eb0; color: #fff; font-family: 'Gill Sans', 'Trebuchet MS', Calibri, sans-serif; font-weight: normal; margin: 0; min-height: 23px; outline: 1px solid #405062; padding: 4px 8px; text-transform: uppercase; } +.green-btn:hover, button.green-btn:hover, input.green-btn:hover { background: #5b7189; border: 1px solid #8e9eb0; } +.form-txt-submit-box input[type=submit] { + padding-top: 0; padding-bottom: 0; width: auto; +} + + +h1, h2, h3, h4, h5, h6, legend { font-family: 'Gill Sans', 'Trebuchet MS', Calibri, sans-serif; } +body { color: #333; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; line-height: 1.4; } + +// #header renamed to #bromley-header +#bromley-header { padding: 0 18px 0 25px; } + +.header-nav {float:right; background:url('https://www.bromley.gov.uk/site/styles/css_img/header-nav.gif') no-repeat; overflow:hidden; width:651px; height:34px; line-height:34px; padding:0 20px;} +.header-nav li {float:left; width:130px; text-align:center; background:url('https://www.bromley.gov.uk/site/styles/css_img/header-nav-divider.gif') top right no-repeat;} +.header-nav li:last-child {background:none;} +.header-nav a:link, .header-nav a:visited {color:#fff; text-decoration:none;} +.header-nav a:hover, .header-nav a:active {text-decoration:underline;} + +/* -------- For Google translate select box only */ +.header-nav div#google_translate_element .goog-te-gadget { font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; } +.header-nav div#google_translate_element .goog-te-gadget .goog-te-combo { margin:5px 0 0 5px; padding:0 0 0 2px; background: #9b9b9b; color: #fff; border: 1px solid #606060; font-size: 12px; width: 138px;} +.header-nav div#google_translate_element .goog-te-gadget .goog-te-combo option { background:#fff; color: #666; padding: 1px 0; margin: 0; } +/* --- */ + +.logo {padding:10px 0;} + +.sign-in {float:right; margin-top:-87px; width: 650px; text-align: right;} +.sign-in a:link, .sign-in a:visited {color:#333; font-weight:bold; text-decoration:none;} +.sign-in a:hover, .sign-in a:active {text-decoration:underline;} + +.main-menu {background:url('https://www.bromley.gov.uk/site/styles/css_img/main-menu.gif') no-repeat; width:689px; height:45px; margin-top:-60px; float:right; clear:right;} +.main-menu li {float:left; width:126px; padding-right:2px; text-align:center; font:150%/45px 'Gill Sans', 'Trebuchet MS', Calibri, sans-serif;} +.main-menu li a:link, .main-menu li a:visited {color:#fff; display:block; text-decoration:none;} +.main-menu li a:hover, .main-menu li a:active {background:url('https://www.bromley.gov.uk/site/styles/css_img/main-menu-hover.gif') repeat-x;} +.main-menu li.home a:hover, .main-menu li.home a:active {background:url('https://www.bromley.gov.uk/site/styles/css_img/main-menu-hover-home.gif') repeat-x;} + +//#search { float: right; padding: 10px 17px; width: 270px; } +//#search label {display:none;} +//#search input { background: #ececec; border: 1px solid #768b9a; border-color: #768b9a #d1dee8 #d1dee8 #768b9a; line-height: 9px; padding: 6px 5px 4px; width: 184px; } +//#search input.button { background: #fff; border: 1px solid #8596a8; color: #333; font-family: 'Gill Sans', 'Trebuchet MS', Calibri, sans-serif; font-size:133%; height: 27px; line-height: 27px; padding: 0; vertical-align: top; width: 70px; } + +// #footer renamed to #bromley-footer, fixed font size. +#bromley-footer { background: #666 url('https://www.bromley.gov.uk/site/styles/css_img/footer.gif') top center no-repeat; clear: both; width:100%; padding:30px 15px 50px; margin-left:-15px; color:#fff; font-size:92%;} +#bromley-footer a:link, +#bromley-footer a:visited { color: #fff; text-decoration: none; } +#bromley-footer a:hover, +#bromley-footer a:active { text-decoration: underline;} +#bromley-footer img { float: right; margin-top: -18px; } +#bromley-footer .footer-nav { float: right; height:35px; margin-top: -15px; } +#bromley-footer .footer-nav li { border-right:1px solid #fff; float: left; line-height: 1; padding: 0 20px; } +#bromley-footer .footer-nav li:last-child { border: none; } + +// Bromley IE specific CSS +.ie6 { + div { zoom: 1; } + #bromley-wrapper { padding: 0; } + #bromley-footer { margin: 0; } + //#search input { padding: 8px 5px 2px; } + //#search input.button { padding: 0; width: 68px; line-height: 24px; } + input.button { overflow: visible; width: 1%; } +} +.ie7 { + div { zoom: 1; } + //#search input { padding: 8px 5px 2px; } + //#search input.button { padding: 0; width: 68px; line-height: 24px; } + input.button { overflow: visible; } +} +.ie8 { + //#search input { padding: 8px 5px 2px; } + //#search input.button { padding: 0; line-height: 24px; } +} + +// mySociety additions +#bromley-header { font-size: 12px; } +.header-nav ul { margin: 0; } +.header-nav li { list-style-type: none; } +// Width is actually 637, but that causes wrap-around, need to ask for fixes and corner image +.main-menu { background: url('/cobrands/bromley/main-menu1.gif') no-repeat; width: 638px; } +.main-menu ul { margin: 0; } +.main-menu li { list-style-type: none; color: #ccf; } +.main-menu li.last { padding-right: 0; } +.main-menu li.last a:hover, .main-menu li.last a:active {background:url('/cobrands/bromley/main-menu-hover-home-right.gif') repeat-x;} +//#search input { display: inline; margin: 0; @include border-radius(0em); } +//#search input.button { font-weight: normal; text-transform: none; } +#bromley-footer { padding-bottom: 60px; } +#bromley-footer .footer-nav li { list-style-type: none; } +#bromley-footer p { margin: 0; } + +#bromley-powered-by { + clear: both; +} + diff --git a/web/cobrands/bromley/favicon.ico b/web/cobrands/bromley/favicon.ico Binary files differnew file mode 100644 index 000000000..cf0577755 --- /dev/null +++ b/web/cobrands/bromley/favicon.ico diff --git a/web/cobrands/bromley/favicon.png b/web/cobrands/bromley/favicon.png Binary files differnew file mode 100644 index 000000000..0acd804e7 --- /dev/null +++ b/web/cobrands/bromley/favicon.png diff --git a/web/cobrands/bromley/fms-logo.png b/web/cobrands/bromley/fms-logo.png Binary files differnew file mode 100644 index 000000000..23bea6b0f --- /dev/null +++ b/web/cobrands/bromley/fms-logo.png diff --git a/web/cobrands/bromley/layout.scss b/web/cobrands/bromley/layout.scss index 3dc34c6c7..eef0ee679 100644 --- a/web/cobrands/bromley/layout.scss +++ b/web/cobrands/bromley/layout.scss @@ -1,11 +1,155 @@ @import "_colours"; @import "../fixmystreet/_layout"; -body { - background: #fff; +body { background: #9b9b9b url('https://www.bromley.gov.uk/site/styles/css_img/repeater.gif') repeat-x; } +#bromley-wrapper { background: #fff url('https://www.bromley.gov.uk/site/styles/css_img/header-corners.gif') center 110px no-repeat; margin: 1px auto 0; padding: 0 15px; width: 955px;} +.offline #bromley-wrapper { padding: 0 15px 20px; } + +// So that map appears underneath the header +.wrapper { + position: relative; +} +.ie6, .ie7 { + .wrapper { + padding-top: 1em; + } +} + +// To prevent font size larger interfering with the fixed Bromley layout +.container { width: auto; } +.full-width { width: 464px; } +.shadow-wrap { width: 464px; } +#map_box { width: 464px; } +.content { width: 432px; } +body.fullwidthpage .content { width: auto; } +body.twothirdswidthpage .content { + width: 640px; + aside { + left: 672px; + width: 208px; + padding: 16px; + } + .sticky-sidebar { + left: 672px; + aside { + top:7em; + } + } +} +.ie6, .ie7 { + body.mappage .container { + width: 464px; + margin-left: 0; + } } #front-main { background: $primary; + @include border-radius(1em 1em 0 0); + margin: 2em 1em 0; + padding-top: 0; + // layout sets this because base has it slightly lighter + h2 { + color: $primary_text; + } + a#geolocate_link { + color: $primary_text; + } +} + +// Don't want gap that normal site has +body.frontpage { + .table-cell { + .content { + margin-top: 0; + } + } +} + +// Don't want FixMyStreet logo on desktop, and we have a skip to content in +// Bromley header +#site-header { + display: none; +} + +#user-meta { + display: none; +} + +// Currently hiding, but do want some internal navigation somewhere at the end +.nav-wrapper { + display: none; +} + +// White background, so no shadow or margin needed. +.content { + margin: 0; + @include box-shadow(none); +} +.ie6, .ie7, .ie8 { + .content { + margin: 0; + border: none; + } +} + +// As map can scroll and isn't at the top, give it an edge +#map_box { + border: solid 1px #999; + top: 1em; + right: 0em; + margin: 0; +} + +// Perhaps fix map location (should be in central?) +.ie6 #map_box, .ie7 #map_box { + right: -480px; +} + +.general-sidebar-notes, +#report-a-problem-sidebar { + position: static; + width: auto; + @include box-shadow(rgba(0, 0, 0, 0), 0, 0, 0); + .sidebar-tips, + .sidebar-notes { + font-size:1em; + } +} + +.ie7 .big-green-banner { + right: 0; +} + +// Pull OpenLayers navigation down a bit +#fms_pan_zoom { + top: 0.5em !important; +} + +// Fix location of aside sidebar +body.twothirdswidthpage { + .content { + aside { + @include box-shadow(none); + } + .sticky-sidebar { + top: 1em; + aside { + position: absolute; + top: 0; + } + } + } +} + +// So as not to interfere with the Bromley footer, make the fixed nav static. +.shadow-wrap { + position: static; + padding-top: 0; + margin-bottom: 1em; + ul#key-tools { + border-top: none; + border-bottom: 1px solid $primary; + } } diff --git a/web/cobrands/bromley/main-menu-hover-home-right.gif b/web/cobrands/bromley/main-menu-hover-home-right.gif Binary files differnew file mode 100644 index 000000000..80c11c782 --- /dev/null +++ b/web/cobrands/bromley/main-menu-hover-home-right.gif diff --git a/web/cobrands/bromley/main-menu1.gif b/web/cobrands/bromley/main-menu1.gif Binary files differnew file mode 100644 index 000000000..21ab45668 --- /dev/null +++ b/web/cobrands/bromley/main-menu1.gif diff --git a/web/cobrands/bromley/position_map.js b/web/cobrands/bromley/position_map.js new file mode 100644 index 000000000..dddef3def --- /dev/null +++ b/web/cobrands/bromley/position_map.js @@ -0,0 +1,19 @@ +function position_map_box() { + var $html = $('html'); + var bromley_right; + if ($html.hasClass('ie6') || $html.hasClass('ie7')) { + bromley_right = '-480px'; + } else { + bromley_right = '0em'; + } + // Do the same as CSS (in case resized from mobile). + $('#map_box').prependTo('.content').css({ + zIndex: 1, position: 'absolute', + top: '1em', left: '', right: bromley_right, bottom: '', + width: '464px', height: '464px', + margin: 0 + }); +} + +function map_fix() {} +var slide_wards_down = 1; diff --git a/web/cobrands/bromley/tab-blue.png b/web/cobrands/bromley/tab-blue.png Binary files differnew file mode 100644 index 000000000..62e6285b7 --- /dev/null +++ b/web/cobrands/bromley/tab-blue.png diff --git a/web/cobrands/fixmystreet/_base.scss b/web/cobrands/fixmystreet/_base.scss index 644b015b5..4d3b36888 100644 --- a/web/cobrands/fixmystreet/_base.scss +++ b/web/cobrands/fixmystreet/_base.scss @@ -31,9 +31,6 @@ h1 { margin-top: 0.5em; margin-bottom: 0.5em; } -#front-main h1 { - margin-top: 0.7em; -} h1#reports_heading span { display: none; } @@ -145,12 +142,23 @@ img { //do this otherwise IE will just not display //any img without a height defined height:auto; + max-width: 100%; +} +// So that map popups display correctly +#popup img { + max-width: none; } select, input, textarea { font-size: 99%; max-width: 95%; } +.ie7 { + select, input, textarea { + max-width: none; + } +} + // To deal with bug from drop-down being wider than holder select { width: 100%; @@ -247,10 +255,27 @@ input[type=password], input[type=email], input[type=file], textarea { + @include box-sizing(border-box); width: 100%; // adjust so the sides line up padding: 0.5em; - margin: 0 0 0 -0.5em; +} +.ie7 { + input[type=text], + input[type=password], + input[type=email], + input[type=file], + textarea { + max-width: 95%; + } + // In order to work around the IE7 specific issue of inheriting left margins + // http://techblog.willshouse.com/2009/07/12/ie6ie7-form-element-margin-inheritance-bug/ + fieldset > input[type=text], + fieldset > input[type=password], + fieldset > input[type=email], + fieldset > textarea { + margin-left: -1em; + } } textarea { @@ -294,7 +319,6 @@ label{ margin: 0 -2em 0.25em -2em; background:#eeeeee; padding:1em 2em 1em 2em; - max-width:26em; >input[type=text] { margin-bottom:1em; } @@ -303,7 +327,7 @@ label{ margin:0.5em 0; } h5 { - margin:0; + margin:0 0 1em; font: { size:1.125em; weight:normal; @@ -319,6 +343,14 @@ label{ // it looks okay. .ie6 .form-box { margin: 0 0 0.25em 0; + padding: 1em; +} +// Prevent grey displaying oddly by giving it a width, and stop odd left margin issue +.ie7 .form-box { + width: 100%; + > input[type=text] { + margin-left: 2em; + } } .form-txt-submit-box { @@ -350,8 +382,14 @@ p.form-error { background:#ff0000; color:#fff; padding:0 0.5em; - margin:0 0 0 -0.5em; @include border-radius(0.25em 0.25em 0 0); + a { + color: white; + text-decoration: underline; + } + a:hover { + text-decoration: none; + } } input.form-error, @@ -364,7 +402,6 @@ ul.error { background:#ff0000; color:#fff; padding:0 0.5em; - margin:0 0 0 -0.5em; @include border-radius(0.25em); } @@ -457,7 +494,8 @@ p.label-valid { &#mysoc-menu{ li { a { - background:$primary; + color: $primary_text; + background: $primary; &#mysoc-logo { background-image:url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIkAAAAyCAMAAABf9whNAAAACW9GRnMAAADwAAAAJgAMZizzAAAACXBIWXMAAABIAAAASABGyWs+AAAACXZwQWcAAAF5AAAQZgCwCYXlAAAANlBMVEUAAAAiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiL///90WH2CAAAAEHRSTlMADx8vP09fb3+Pn6+/z9/v+t8hjgAAAAFiS0dEEeK1PboAAAGqSURBVFjD7ZbNjtwgEAY/oIE2YKj3f9ocPDOZ3eN6FCUKdWsJQ+H+saXNZrPZbDabzf/GovwdIhH8LUzHn/PqI32Jcw1v0fjidQf30EZPqmMURXeT5F5kbYwqSQbeWpAU6xg961pT+mgm+WR4Ke6SzG9JwQRWB6iaTClCzQBLknT0AibZAnCBSx2ALACGQ5JOznsmq1TA82LKIalC6Jwh5seaMGdUWKxiJQpclWVqLNlJsxThUIB6z8Qft3FQgEODrs4qUuj9qoljpAr2euKkmxVIjzrpTBUI90xMGgzJQGrMAEUGrGKQn6c7/HbngT1MMqRO1wdNDA6WpNgW5Ld38s1kuLt7fPbO5Lg7Z76ZaLJoV3WAa6wsxbmiyrMMruyMVxc3SaqvAv+YSQWS1Fs9oAi8jQKmsGB4zwJXgdO9VWnAkaUAHJ81CTAkLYAm5ZbB/QhSmm9d7Ff7Splr5jaI90zMgpQsScHsGmRFUsheH6O1jecR5m5BZlFSzF5NkpJ7lMJ85etDlPWjHdMJ6aMiFdYPdgzw6Q90Yvwo2+fM+3dps9lsNpvNP8gvi7UYry9B6TcAAAAldEVYdGRhdGU6Y3JlYXRlADIwMTItMDUtMDJUMTk6NDY6NTErMDE6MDAcdbR4AAAAJXRFWHRkYXRlOm1vZGlmeQAyMDEyLTA1LTAyVDE5OjQ2OjUxKzAxOjAwbSgMxAAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAAASUVORK5CYII='); background-repeat:no-repeat; @@ -485,7 +523,8 @@ p.label-valid { #user-meta { p { position: relative; - background:$primary; + color: $primary_text; + background: $primary; padding:1em 6em 1em 1em; a { position: absolute; @@ -518,7 +557,11 @@ p.label-valid { &:last-child { border-right:none; } - a { + input[type=submit] { + width: 100%; + border: none; + } + a, input[type=submit] { display: block; background-color: #f5f5f5; background-repeat: no-repeat; @@ -529,7 +572,7 @@ p.label-valid { size:0.6875em; family: Helmet, Freesans, sans-serif; } - &:hover, &.hover, &.active { + &:hover, &.hover { text-decoration:none; background-color:#333; color:#fff; @@ -546,7 +589,7 @@ p.label-valid { background-image:url('/cobrands/fixmystreet/images/sprite.png'); background-position:center -2716px; } - &.hover, &.active { + &.hover { background-image:url('/cobrands/fixmystreet/images/sprite.png'); background-position:center -2064px; } @@ -717,7 +760,7 @@ a:hover.button-left { width: 0; height: 0; border-left: 0.5em solid transparent; - border-bottom: 0.5em solid #4B8304; + border-bottom: 0.5em solid $contrast1_dark; } } @@ -753,7 +796,7 @@ a:hover.button-left { color:#fff; background: $contrast1; &:before { - border-bottom: 0.5em solid #4B8304; + border-bottom: 0.5em solid $contrast1_dark; } } } @@ -838,6 +881,7 @@ a:hover.button-left { } .img { text-align:right; + width: 90px; img { height:auto; } @@ -906,7 +950,7 @@ a:hover.button-left { width:20px; height:20px; opacity: 0.5; - background:#fff url(images/sprite.png) -16px -1098px no-repeat; + background:#fff url(/cobrands/fixmystreet/images/sprite.png) -16px -1098px no-repeat; //hide text - http://nicolasgallagher.com/another-css-image-replacement-technique/ font: 0/0 a; color: transparent; @@ -1286,7 +1330,8 @@ table.nicetable { .promo { @extend .full-width; - background:$primary; + color: $primary_text; + background: $primary; padding:1em; margin-bottom:1em; overflow:hidden; @@ -1299,10 +1344,10 @@ table.nicetable { width:16px; height:16px; text-indent:-999999px; - background:url(images/sprite.png) -341px -263px no-repeat; + background:url(/cobrands/fixmystreet/images/sprite.png) -341px -263px no-repeat; @include border-radius(4px); &:hover { - background:#222 url(images/sprite.png) -341px -223px no-repeat; + background:#222 url(/cobrands/fixmystreet/images/sprite.png) -341px -223px no-repeat; } } } @@ -1333,7 +1378,8 @@ table.nicetable { } a { @include inline-block; - background:$primary; + color: $primary_text; + background: $primary; padding-left:0.5em; padding-right:0.5em; color:#1a1a1a; @@ -1347,7 +1393,7 @@ table.nicetable { // this is a bit of a hack to get some differentation between desk and mobile .desk-only { - display:none !important; + display:none; } // hide anything with this class if js is working @@ -1366,6 +1412,7 @@ table.nicetable { /* Front page */ #front-main { text-align:center; + margin: 1em; h2 { font: { style:italic; @@ -1374,6 +1421,9 @@ table.nicetable { } color:#4d4d4d; } + p { + margin: 0.5em 0 0; + } #postcodeForm { @extend .full-width; padding:1em; @@ -1392,7 +1442,7 @@ table.nicetable { display:table-cell; margin:0; padding:0.25em 2%; - width:82%; + width:86%; border:none; background:none; line-height:1.5em; @@ -1460,7 +1510,6 @@ table.nicetable { #front-recently { .issue-list-a { border-bottom:none; - margin-bottom:0; } } diff --git a/web/cobrands/fixmystreet/_colours.scss b/web/cobrands/fixmystreet/_colours.scss index 2463cdeeb..1a62d0282 100644 --- a/web/cobrands/fixmystreet/_colours.scss +++ b/web/cobrands/fixmystreet/_colours.scss @@ -5,4 +5,5 @@ $primary_b: #F3B11E; $primary_text: #222; $contrast1: #00BD08; +$contrast1_dark: #4B8304; $contrast2: #AA8D11; diff --git a/web/cobrands/fixmystreet/_layout.scss b/web/cobrands/fixmystreet/_layout.scss index 6a32ea010..56b2f41d5 100644 --- a/web/cobrands/fixmystreet/_layout.scss +++ b/web/cobrands/fixmystreet/_layout.scss @@ -3,10 +3,10 @@ //hacks for desk/mob only stuff .desk-only { - display:block !important; + display: block; } .mob-only { - display:none !important; + display: none; } body { @@ -147,7 +147,8 @@ h1 { @include background(linear-gradient(#000, #444 10%, #444 95%, #111)); } a.report-a-problem-btn { - background:$primary; + color: $primary_text; + background: $primary; padding:0.25em; margin:0.5em; color:#333; @@ -197,28 +198,23 @@ h1 { // .content Is the white box // The narrow single column box -.content{ +.content { width: 27em; margin-top: 3em; - background: #fff; - padding: 1em; - padding-bottom: 3em; - margin-left: 0.5em; margin-bottom: -1em; + margin-left: 0.5em; + padding: 1em 1em 3em; + background: #fff; @include box-shadow(0px 0px 6px 1px #000); } .ie6, .ie7, .ie8 { .content { // If no box-shadow, just want a boring black border to stand it out from the map. - border: 1px solid black; + border: 1px solid #666; //take off margins so we line up properly - margin: 0; + margin: 0 0 0 0.5em; } } -//weird margining thing for ie8 -.ie8 .content { - margin-top:3em; -} // map page - has fixed header and different styling body.mappage { @@ -253,7 +249,7 @@ body.mappage { .container { float: left; width: 27em; - margin-left: 1.4em; + margin-left: 0.7em; } .nav-wrapper{ z-index:1; @@ -266,13 +262,6 @@ body.mappage { } } } -.ie6 { - body.mappage { - .container { - margin-left: 0.7em; - } - } -} //ie8 needs different stuff on .nav-wrapper so we //have to define all the rest of it again as this resets //the z-index base yet again :S @@ -304,7 +293,6 @@ body.fullwidthpage { } // two thirds width page, also has option for a sidebar which can be sticky or not body.twothirdswidthpage { - @extend .fullwidthpage; .content { width:40em; position: relative; @@ -588,7 +576,7 @@ body.twothirdswidthpage { @include box-shadow(-0em 0px 1em 1em #fff); li { border:none; - a { + a, input[type=submit] { font-size: 0.75em; color:#666; padding: 0.5em 1.5em 0.5em 0; @@ -644,9 +632,14 @@ body.twothirdswidthpage { top:-0.5em; position: absolute; border-top: 0.5em solid transparent; - border-left: 0.5em solid #4B8304; + border-left: 0.5em solid $contrast1_dark; border-bottom:none; } + span { + display: block; + font-size: 80%; + padding-top: 0.5em; + } } .ie6 .big-green-banner { background: $contrast1 url(/cobrands/fixmystreet/images/ie_green_chevron.gif) right center no-repeat; @@ -668,7 +661,7 @@ body.twothirdswidthpage { background-position:-324px -326px; background-repeat:no-repeat; &:before { - border-bottom: 0.75em solid #4B8304; + border-bottom: 0.75em solid $contrast1_dark; } } } @@ -694,18 +687,13 @@ input[type=text], input[type=password], input[type=email], textarea{ - width: 25em; -} -.form-box { - max-width:25em; + max-width: 25em; } - /* form errors */ div.form-error, p.form-error { display:block; - width:24.7em; } input.form-error, @@ -735,7 +723,7 @@ textarea.form-error { } } .ie6, .ie7 { - #report-a-problem-sidebar { + #report-a-problem-sidebar, .general-sidebar-notes { left: 29em; // 0.5em left margin gone on .content in IE6/7, so reduce this accordingly. } } @@ -774,19 +762,15 @@ textarea.form-error { body.frontpage { .table-cell { - // we do this so we can have full screen width elements - >.container { - width:100%; - } .content { - margin:14em auto 0 auto; + margin: 1em auto 0; } } .nav-wrapper-2{ height:6em; } #site-header{ - height:9em; + height:8em; } #site-logo{ top:3em; @@ -799,7 +783,7 @@ body.frontpage { p { top:-4em; right:0; - color:#FFD000; + color:$primary; background:none; @include box-shadow(rgba(0, 0, 0, 0) 0 0 0); a { @@ -825,7 +809,7 @@ body.frontpage { .ie6, .ie7 { body.frontpage { #site-header { - height:3em; + height:4em; } #site-logo { top:-1em; @@ -838,24 +822,13 @@ body.frontpage { .ie6 body.frontpage #site-logo { background:url(/cobrands/fixmystreet/images/ie_front_logo.gif) 0 0 no-repeat; } -//weird margining thing for ie8 -.ie8 body.frontpage { - #front-main { - top:-12em; - } - .table-cell .content { - margin-top:12em; - } -} // big yellow bit full screen width #front-main { color: $primary_text; background: $primary url(/cobrands/fixmystreet/images/tile-y.jpg); - position:absolute; - width:100%; - left:0; - top:-15em; + margin: 0; + padding: 1em; #front-main-container { max-width: 57em; margin:0 auto; @@ -868,6 +841,7 @@ body.frontpage { #postcodeForm { background:none; overflow:hidden; + padding-bottom: 0; margin-right:0.5em; label { margin:0.5em 0; @@ -881,8 +855,8 @@ body.frontpage { display:block; float:left; padding:0.25em 0.5em; - height:1.5em; - width:16em; + height:2em; + width:17em; } input#submit { display:block; @@ -893,27 +867,40 @@ body.frontpage { } } } + a { + color: $primary_text; + text-decoration: underline; + &:hover { + text-decoration: none; + } + } a#geolocate_link { background:none; color:#222; - margin:-1em 0 0.5em 0; + text-decoration: none; + padding-bottom: 0; &:hover { text-decoration:underline; background:none; } } } -.ie6, .ie7 { - #front-main { - top:2em; +.ie7 #front-main { + #postcodeForm { + div { + input#pc { + height:1.5em; + width:16em; + } + } } } - #front-howto { border-right:1em solid #fff; #front_stats { background:none; + color: #222; border-top:0.25em solid $primary; padding-top:1em; div { diff --git a/web/cobrands/fixmystreet/fixmystreet.js b/web/cobrands/fixmystreet/fixmystreet.js index 9d5151189..c8ed8ae51 100644 --- a/web/cobrands/fixmystreet/fixmystreet.js +++ b/web/cobrands/fixmystreet/fixmystreet.js @@ -3,33 +3,6 @@ * FixMyStreet JavaScript */ -function form_category_onchange() { - var cat = $('#form_category'); - var args = { - category: cat.val() - }; - - if ( typeof fixmystreet !== 'undefined' ) { - args.latitude = fixmystreet.latitude; - args.longitude = fixmystreet.longitude; - } else { - args.latitude = $('input[name="latitude"]').val(); - args.longitude = $('input[name="longitude"]').val(); - } - - $.getJSON('/report/new/category_extras', args, 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(); - } - }); -} - /* * general height fixing function * @@ -80,12 +53,12 @@ function tabs(elem, indirect) { $(function(){ var $html = $('html'); - $html.removeClass('no-js').addClass('js'); - - - // Preload the new report pin - document.createElement('img').src = '/i/pin-green.png'; + var cobrand; + if (window.location.href.indexOf('bromley') != -1) { + cobrand = 'bromley'; + } + // Deal with switching between mobile and desktop versions on resize var last_type; $(window).resize(function(){ var type = $('#site-header').css('borderTopWidth'); @@ -106,7 +79,9 @@ $(function(){ } if (typeof fixmystreet !== 'undefined' && fixmystreet.page == 'around') { // Immediately go full screen map if on around page - $('#site-header').hide(); + if (cobrand != 'bromley') { + $('#site-header').hide(); + } $('#map_box').prependTo('.wrapper').css({ position: 'absolute', top: 0, left: 0, right: 0, bottom: 0, @@ -128,167 +103,33 @@ $(function(){ } else { // Make map full screen on non-mobile sizes. $html.removeClass('mobile'); - var map_pos = 'fixed', map_height = '100%'; - if ($html.hasClass('ie6')) { - map_pos = 'absolute'; - map_height = $(window).height(); - } - $('#map_box').prependTo('.wrapper').css({ - zIndex: 0, position: map_pos, - top: 0, left: 0, right: 0, bottom: 0, - width: '100%', height: map_height, - margin: 0 - }); + position_map_box(); if (typeof fixmystreet !== 'undefined') { - fixmystreet.state_map = 'full'; + if (cobrand == 'bromley') { + //$('#bromley-footer').hide(); + } else { + fixmystreet.state_map = 'full'; + } } if (typeof fixmystreet !== 'undefined' && fixmystreet.page == 'around') { // Remove full-screen-ness - $('#site-header').show(); + var banner_text; + if (cobrand == 'bromley') { + banner_text = 'Click map to report a problem<span>Yellow pins show existing reports</span>'; + } else { + $('#site-header').show(); + banner_text = 'Click map to report a problem'; + } $('#fms_pan_zoom').css({ top: '4.75em !important' }); $('.big-green-banner') .removeClass('mobile-map-banner') .prependTo('#side') - .text('Click map to report a problem'); + .html(banner_text); } $('span.report-a-problem-btn').css({ cursor:'' }).off('.reportBtn'); } last_type = type; - }); - - //add mobile class if small screen - $(window).resize(); - - $('#pc').focus(); - - $('input[type=submit]').removeAttr('disabled'); - /* - $('#mapForm').submit(function() { - if (this.submit_problem) { - $('input[type=submit]', this).prop("disabled", true); - } - return true; - }); - */ - - if (!$('#been_fixed_no').prop('checked') && !$('#been_fixed_unknown').prop('checked')) { - $('#another_qn').hide(); - } - $('#been_fixed_no').click(function() { - $('#another_qn').show('fast'); - }); - $('#been_fixed_unknown').click(function() { - $('#another_qn').show('fast'); - }); - $('#been_fixed_yes').click(function() { - $('#another_qn').hide('fast'); - }); - - // FIXME - needs to use translated string - jQuery.validator.addMethod('validCategory', function(value, element) { - return this.optional(element) || value != '-- Pick a category --'; }, validation_strings.category ); - - jQuery.validator.addMethod('validName', function(value, element) { - var validNamePat = /\ba\s*n+on+((y|o)mo?u?s)?(ly)?\b/i; - return this.optional(element) || value.length > 5 && value.match( /\S/ ) && !value.match( validNamePat ); }, validation_strings.category ); - - var form_submitted = 0; - var submitted = false; - - $("form.validate").validate({ - rules: { - title: { required: true }, - detail: { required: true }, - email: { required: true }, - update: { required: true }, - rznvy: { required: true } - }, - messages: validation_strings, - onkeyup: false, - onfocusout: false, - errorElement: 'div', - errorClass: 'form-error', - // we do this to stop things jumping around on blur - success: function (err) { if ( form_submitted ) { err.addClass('label-valid').removeClass('label-valid-hidden').html( ' ' ); } else { err.addClass('label-valid-hidden'); } }, - errorPlacement: function( error, element ) { - element.before( error ); - }, - submitHandler: function(form) { - if (form.submit_problem) { - $('input[type=submit]', form).prop("disabled", true); - } - - form.submit(); - }, - // make sure we can see the error message when we focus on invalid elements - showErrors: function( errorMap, errorList ) { - if ( submitted && errorList.length ) { - $(window).scrollTop( $(errorList[0].element).offset().top - 120 ); - } - this.defaultShowErrors(); - submitted = false; - }, - invalidHandler: function(form, validator) { submitted = true; } - }); - - $('input[type=submit]').click( function(e) { form_submitted = 1; } ); - - /* set correct required status depending on what we submit - * NB: need to add things to form_category as the JS updating - * of this we do after a map click removes them */ - $('#submit_sign_in').click( function(e) { - $('#form_category').addClass('required validCategory').removeClass('valid'); - $('#form_name').removeClass(); - } ); - - $('#submit_register').click( function(e) { - $('#form_category').addClass('required validCategory').removeClass('valid'); - $('#form_name').addClass('required validName'); - } ); - - $('#problem_submit > input[type="submit"]').click( function(e) { - $('#form_category').addClass('required validCategory').removeClass('valid'); - $('#form_name').addClass('required validName'); - } ); - - $('#update_post').click( function(e) { - $('#form_name').addClass('required').removeClass('valid'); - } ); - - $('#form_category').change( form_category_onchange ); - - // Geolocation - if (geo_position_js.init()) { - $('#postcodeForm').after('<a href="#" id="geolocate_link">… or locate me automatically</a>'); - $('#geolocate_link').click(function(e) { - e.preventDefault(); - // Spinny thing! - if($('.mobile').length){ - $(this).append(' <img src="/cobrands/fixmystreet/images/spinner-black.gif" alt="" align="bottom">'); - }else{ - $(this).append(' <img src="/cobrands/fixmystreet/images/spinner-yellow.gif" alt="" align="bottom">'); - } - geo_position_js.getCurrentPosition(function(pos) { - $('img', this).remove(); - var latitude = pos.coords.latitude; - var longitude = pos.coords.longitude; - location.href = '/around?latitude=' + latitude + ';longitude=' + longitude; - }, function(err) { - $('img', this).remove(); - if (err.code == 1) { // User said no - } else if (err.code == 2) { // No position - $(this).html("Could not look up location"); - } else if (err.code == 3) { // Too long - $('this').html("No result returned"); - } else { // Unknown - $('this').html("Unknown error"); - } - }, { - enableHighAccuracy: true, - timeout: 10000 - }); - }); - } + }).resize(); /* * Report a problem page @@ -361,10 +202,15 @@ $(function(){ /* * Show stuff on input focus */ - $('.form-focus-hidden').hide(); - $('.form-focus-trigger').on('focus', function(){ - $('.form-focus-hidden').fadeIn(500); - }); + var form_focus_data = $('.form-focus-trigger').map(function() { + return $(this).val(); + }).get().join(''); + if (!form_focus_data) { + $('.form-focus-hidden').hide(); + $('.form-focus-trigger').on('focus', function(){ + $('.form-focus-hidden').fadeIn(500); + }); + } /* * Show on click - pretty generic @@ -479,12 +325,12 @@ $.fn.drawer = function(id, ajax) { }); }; - if ($('html.mobile').length) { + if ($('html.mobile').length || slide_wards_down ) { $('#council_wards').hide().removeClass('hidden-js').find('h2').hide(); $('#key-tool-wards').click(function(e){ e.preventDefault(); $('#council_wards').slideToggle('800', function(){ - $('#key-tool-wards').toggleClass('active'); + $('#key-tool-wards').toggleClass('hover'); }); }); } else { @@ -508,6 +354,7 @@ $.fn.drawer = function(id, ajax) { var $v = $(this); $('<input/>').attr({ name:$v.attr('name'), value:$v.val(), type:'hidden' }).appendTo(form); }); + $('body').append(form); form.submit(); }); @@ -575,7 +422,13 @@ $.fn.drawer = function(id, ajax) { */ if (!$('html.mobile').length) { if (!($('body').hasClass('frontpage'))){ - heightFix(window, '.content', -176); + var offset = -176; + if (cobrand == 'bromley') { + offset = -110; + } + heightFix(window, '.content', offset); + // in case we have a map that isn't full screen + map_fix(); } } diff --git a/web/cobrands/fixmystreet/position_map.js b/web/cobrands/fixmystreet/position_map.js new file mode 100644 index 000000000..4a18d9f9a --- /dev/null +++ b/web/cobrands/fixmystreet/position_map.js @@ -0,0 +1,21 @@ +function position_map_box() { + var $html = $('html'); + if ($html.hasClass('ie6')) { + $('#map_box').prependTo('.wrapper').css({ + zIndex: 0, position: 'absolute', + top: 0, left: 0, right: 0, bottom: 0, + width: '100%', height: $(window).height(), + margin: 0 + }); + } else { + $('#map_box').prependTo('.wrapper').css({ + zIndex: 0, position: 'fixed', + top: 0, left: 0, right: 0, bottom: 0, + width: '100%', height: '100%', + margin: 0 + }); + } +} + +function map_fix() {} +var slide_wards_down = 0; diff --git a/web/css/core.scss b/web/css/core.scss index a38a188ce..72e483dfa 100644 --- a/web/css/core.scss +++ b/web/css/core.scss @@ -114,7 +114,9 @@ $map_width: 500px; } } - #geolocate_para { + #geolocate_link { + display: block; + border: none; font-size: 70%; margin: 2px 0 0 0; text-align: right; @@ -609,7 +611,7 @@ $map_width: 500px; } } - #geolocate_para { + #geolocate_link { font-size: 100%; } diff --git a/web/js/fancybox/jquery.fancybox-1.3.4.js b/web/js/fancybox/jquery.fancybox-1.3.4.js index be7727537..728aa6a51 100644 --- a/web/js/fancybox/jquery.fancybox-1.3.4.js +++ b/web/js/fancybox/jquery.fancybox-1.3.4.js @@ -943,7 +943,7 @@ $(window).unbind("resize.fb scroll.fb");
$(document).unbind('keydown.fb');
- content.find('iframe').attr('src', isIE6 && /^https/i.test(window.location.href || '') ? 'javascript:void(false)' : 'about:blank');
+ content.find('iframe').attr('src', isIE6 && /^https/i.test(window.location.href || '') ? '/js/fancybox/blank.gif' : 'about:blank');
if (currentOpts.titlePosition !== 'inside') {
title.empty();
@@ -1090,7 +1090,7 @@ loading.addClass('fancybox-ie6');
wrap.addClass('fancybox-ie6');
- $('<iframe id="fancybox-hide-sel-frame" src="' + (/^https/i.test(window.location.href || '') ? 'javascript:void(false)' : 'about:blank' ) + '" scrolling="no" border="0" frameborder="0" tabindex="-1"></iframe>').prependTo(outer);
+ $('<iframe id="fancybox-hide-sel-frame" src="' + (/^https/i.test(window.location.href || '') ? '/js/fancybox/blank.gif' : 'about:blank' ) + '" scrolling="no" border="0" frameborder="0" tabindex="-1"></iframe>').prependTo(outer);
}
};
@@ -1153,4 +1153,4 @@ $.fancybox.init();
});
-})(jQuery);
\ No newline at end of file +})(jQuery);
diff --git a/web/js/fancybox/jquery.fancybox-1.3.4.pack.js b/web/js/fancybox/jquery.fancybox-1.3.4.pack.js index 1373ed083..d5bd61fe9 100644 --- a/web/js/fancybox/jquery.fancybox-1.3.4.pack.js +++ b/web/js/fancybox/jquery.fancybox-1.3.4.pack.js @@ -37,10 +37,10 @@ j.css({width:c.width-d.padding*2,height:c.height-y*a-d.padding*2})},U=function() b.fn.fancybox=function(a){if(!b(this).length)return this;b(this).data("fancybox",b.extend({},a,b.metadata?b(this).metadata():{})).unbind("click.fb").bind("click.fb",function(c){c.preventDefault();if(!h){h=true;b(this).blur();o=[];q=0;c=b(this).attr("rel")||"";if(!c||c==""||c==="nofollow")o.push(this);else{o=b("a[rel="+c+"], area[rel="+c+"]");q=o.index(this)}I()}});return this};b.fancybox=function(a,c){var g;if(!h){h=true;g=typeof c!=="undefined"?c:{};o=[];q=parseInt(g.index,10)||0;if(b.isArray(a)){for(var k= 0,C=a.length;k<C;k++)if(typeof a[k]=="object")b(a[k]).data("fancybox",b.extend({},g,a[k]));else a[k]=b({}).data("fancybox",b.extend({content:a[k]},g));o=jQuery.merge(o,a)}else{if(typeof a=="object")b(a).data("fancybox",b.extend({},g,a));else a=b({}).data("fancybox",b.extend({content:a},g));o.push(a)}if(q>o.length||q<0)q=0;I()}};b.fancybox.showActivity=function(){clearInterval(K);t.show();K=setInterval(Z,66)};b.fancybox.hideActivity=function(){t.hide()};b.fancybox.next=function(){return b.fancybox.pos(p+ 1)};b.fancybox.prev=function(){return b.fancybox.pos(p-1)};b.fancybox.pos=function(a){if(!h){a=parseInt(a);o=l;if(a>-1&&a<l.length){q=a;I()}else if(d.cyclic&&l.length>1){q=a>=l.length?0:l.length-1;I()}}};b.fancybox.cancel=function(){if(!h){h=true;b.event.trigger("fancybox-cancel");N();e.onCancel(o,q,e);h=false}};b.fancybox.close=function(){function a(){u.fadeOut("fast");n.empty().hide();f.hide();b.event.trigger("fancybox-cleanup");j.empty();d.onClosed(l,p,d);l=e=[];p=q=0;d=e={};h=false}if(!(h||f.is(":hidden"))){h= -true;if(d&&false===d.onCleanup(l,p,d))h=false;else{N();b(E.add(z).add(A)).hide();b(j.add(u)).unbind();b(window).unbind("resize.fb scroll.fb");b(document).unbind("keydown.fb");j.find("iframe").attr("src",M&&/^https/i.test(window.location.href||"")?"javascript:void(false)":"about:blank");d.titlePosition!=="inside"&&n.empty();f.stop();if(d.transitionOut=="elastic"){r=V();var c=f.position();i={top:c.top,left:c.left,width:f.width(),height:f.height()};if(d.opacity)i.opacity=1;n.empty().hide();B.prop=1; +true;if(d&&false===d.onCleanup(l,p,d))h=false;else{N();b(E.add(z).add(A)).hide();b(j.add(u)).unbind();b(window).unbind("resize.fb scroll.fb");b(document).unbind("keydown.fb");j.find("iframe").attr("src",M&&/^https/i.test(window.location.href||"")?"/js/fancybox/blank.gif":"about:blank");d.titlePosition!=="inside"&&n.empty();f.stop();if(d.transitionOut=="elastic"){r=V();var c=f.position();i={top:c.top,left:c.left,width:f.width(),height:f.height()};if(d.opacity)i.opacity=1;n.empty().hide();B.prop=1; b(B).animate({prop:0},{duration:d.speedOut,easing:d.easingOut,step:T,complete:a})}else f.fadeOut(d.transitionOut=="none"?0:d.speedOut,a)}}};b.fancybox.resize=function(){u.is(":visible")&&u.css("height",b(document).height());b.fancybox.center(true)};b.fancybox.center=function(a){var c,g;if(!h){g=a===true?1:0;c=U();!g&&(f.width()>c[0]||f.height()>c[1])||f.stop().animate({top:parseInt(Math.max(c[3]-20,c[3]+(c[1]-j.height()-40)*0.5-d.padding)),left:parseInt(Math.max(c[2]-20,c[2]+(c[0]-j.width()-40)*0.5- d.padding))},typeof a=="number"?a:200)}};b.fancybox.init=function(){if(!b("#fancybox-wrap").length){b("body").append(m=b('<div id="fancybox-tmp"></div>'),t=b('<div id="fancybox-loading"><div></div></div>'),u=b('<div id="fancybox-overlay"></div>'),f=b('<div id="fancybox-wrap"></div>'));D=b('<div id="fancybox-outer"></div>').append('<div class="fancybox-bg" id="fancybox-bg-n"></div><div class="fancybox-bg" id="fancybox-bg-ne"></div><div class="fancybox-bg" id="fancybox-bg-e"></div><div class="fancybox-bg" id="fancybox-bg-se"></div><div class="fancybox-bg" id="fancybox-bg-s"></div><div class="fancybox-bg" id="fancybox-bg-sw"></div><div class="fancybox-bg" id="fancybox-bg-w"></div><div class="fancybox-bg" id="fancybox-bg-nw"></div>').appendTo(f); D.append(j=b('<div id="fancybox-content"></div>'),E=b('<a id="fancybox-close"></a>'),n=b('<div id="fancybox-title"></div>'),z=b('<a href="javascript:;" id="fancybox-left"><span class="fancy-ico" id="fancybox-left-ico"></span></a>'),A=b('<a href="javascript:;" id="fancybox-right"><span class="fancy-ico" id="fancybox-right-ico"></span></a>'));E.click(b.fancybox.close);t.click(b.fancybox.cancel);z.click(function(a){a.preventDefault();b.fancybox.prev()});A.click(function(a){a.preventDefault();b.fancybox.next()}); -b.fn.mousewheel&&f.bind("mousewheel.fb",function(a,c){if(h)a.preventDefault();else if(b(a.target).get(0).clientHeight==0||b(a.target).get(0).scrollHeight===b(a.target).get(0).clientHeight){a.preventDefault();b.fancybox[c>0?"prev":"next"]()}});b.support.opacity||f.addClass("fancybox-ie");if(M){t.addClass("fancybox-ie6");f.addClass("fancybox-ie6");b('<iframe id="fancybox-hide-sel-frame" src="'+(/^https/i.test(window.location.href||"")?"javascript:void(false)":"about:blank")+'" scrolling="no" border="0" frameborder="0" tabindex="-1"></iframe>').prependTo(D)}}}; +b.fn.mousewheel&&f.bind("mousewheel.fb",function(a,c){if(h)a.preventDefault();else if(b(a.target).get(0).clientHeight==0||b(a.target).get(0).scrollHeight===b(a.target).get(0).clientHeight){a.preventDefault();b.fancybox[c>0?"prev":"next"]()}});b.support.opacity||f.addClass("fancybox-ie");if(M){t.addClass("fancybox-ie6");f.addClass("fancybox-ie6");b('<iframe id="fancybox-hide-sel-frame" src="'+(/^https/i.test(window.location.href||"")?"/js/fancybox/blank.gif":"about:blank")+'" scrolling="no" border="0" frameborder="0" tabindex="-1"></iframe>').prependTo(D)}}}; b.fn.fancybox.defaults={padding:10,margin:40,opacity:false,modal:false,cyclic:false,scrolling:"auto",width:560,height:340,autoScale:true,autoDimensions:true,centerOnScroll:false,ajax:{},swf:{wmode:"transparent"},hideOnOverlayClick:true,hideOnContentClick:false,overlayShow:true,overlayOpacity:0.7,overlayColor:"#777",titleShow:true,titlePosition:"float",titleFormat:null,titleFromAlt:false,transitionIn:"fade",transitionOut:"fade",speedIn:300,speedOut:300,changeSpeed:300,changeFade:"fast",easingIn:"swing", -easingOut:"swing",showCloseButton:true,showNavArrows:true,enableEscapeButton:true,enableKeyboardNav:true,onStart:function(){},onCancel:function(){},onComplete:function(){},onCleanup:function(){},onClosed:function(){},onError:function(){}};b(document).ready(function(){b.fancybox.init()})})(jQuery);
\ No newline at end of file +easingOut:"swing",showCloseButton:true,showNavArrows:true,enableEscapeButton:true,enableKeyboardNav:true,onStart:function(){},onCancel:function(){},onComplete:function(){},onCleanup:function(){},onClosed:function(){},onError:function(){}};b(document).ready(function(){b.fancybox.init()})})(jQuery); diff --git a/web/js/fixmystreet-old-box.js b/web/js/fixmystreet-old-box.js new file mode 100644 index 000000000..72eeafb4d --- /dev/null +++ b/web/js/fixmystreet-old-box.js @@ -0,0 +1,39 @@ +/* + * fixmystreet-old-box.js + * Create the 'email me updates' pop up box on old-style report display pages. + */ + +$(function(){ + + if (!$('#email_alert_box').length) { + return; + } + + var timer; + function email_alert_close() { + $('#email_alert_box').hide('fast'); + } + + $('#email_alert').click(function(e) { + e.preventDefault(); + if ($('#email_alert_box').is(':visible')) { + email_alert_close(); + } else { + var pos = $(this).position(); + $('#email_alert_box').css( { 'left': ( pos.left - 20 ) + 'px', 'top': ( pos.top + 20 ) + 'px' } ); + $('#email_alert_box').show('fast'); + $('#alert_rznvy').focus(); + } + }).hover(function() { + window.clearTimeout(timer); + }, function() { + timer = window.setTimeout(email_alert_close, 2000); + }); + + $('#email_alert_box').hover(function() { + window.clearTimeout(timer); + }, function() { + timer = window.setTimeout(email_alert_close, 2000); + }); + +}); diff --git a/web/js/fixmystreet.js b/web/js/fixmystreet.js index 834aa4ed3..36d47b5b2 100644 --- a/web/js/fixmystreet.js +++ b/web/js/fixmystreet.js @@ -1,51 +1,31 @@ /* * fixmystreet.js - * FixMyStreet JavaScript + * FixMyStreet JavaScript used by all cobrands. + * With the JavaScript written more proper like. */ -function form_category_onchange() { - var cat = $('#form_category'); - var args = { - category: cat.val() - }; - - if ( typeof fixmystreet !== 'undefined' ) { - args.latitude = fixmystreet.latitude; - args.longitude = fixmystreet.longitude; - } else { - args.latitude = $('input[name="latitude"]').val(); - args.longitude = $('input[name="longitude"]').val(); - } - - $.getJSON('/report/new/category_extras', args, 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($){ +/* + Deal with changes to category by asking for details from the server. + */ $(function(){ - $('html').removeClass('no-js').addClass('js'); + var $html = $('html'); + + // Add a class to the whole page saying JavaScript is enabled (for CSS and so on) + $html.removeClass('no-js').addClass('js'); + // Preload the new report pin + document.createElement('img').src = '/i/pin-green.png'; + + // Focus on postcode box on front page $('#pc').focus(); + // In case we've come here by clicking back to a form that disabled a submit button $('input[type=submit]').removeAttr('disabled'); - /* - $('#mapForm').submit(function() { - if (this.submit_problem) { - $('input[type=submit]', this).prop("disabled", true); - } - return true; - }); - */ + // Questionnaire hide/showings if (!$('#been_fixed_no').prop('checked') && !$('#been_fixed_unknown').prop('checked')) { $('#another_qn').hide(); } @@ -59,10 +39,7 @@ $(function(){ $('#another_qn').hide('fast'); }); - var timer; - function email_alert_close() { - $('#email_alert_box').hide('fast'); - } + // Form validation // FIXME - needs to use translated string jQuery.validator.addMethod('validCategory', function(value, element) { @@ -85,12 +62,18 @@ $(function(){ }, messages: validation_strings, onkeyup: false, + onfocusout: false, errorElement: 'div', errorClass: 'form-error', // we do this to stop things jumping around on blur success: function (err) { if ( form_submitted ) { err.addClass('label-valid').removeClass('label-valid-hidden').html( ' ' ); } else { err.addClass('label-valid-hidden'); } }, errorPlacement: function( error, element ) { - element.parent('div').before( error ); + // Different for old/new style design + if ($('.form-field').length) { + element.parent('div.form-field').before( error ); + } else { + element.before( error ); + } }, submitHandler: function(form) { if (form.submit_problem) { @@ -102,7 +85,7 @@ $(function(){ // make sure we can see the error message when we focus on invalid elements showErrors: function( errorMap, errorList ) { if ( submitted && errorList.length ) { - $(window).scrollTop( $(errorList[0].element).offset().top - 40 ); + $(window).scrollTop( $(errorList[0].element).offset().top - 120 ); } this.defaultShowErrors(); submitted = false; @@ -112,83 +95,105 @@ $(function(){ $('input[type=submit]').click( function(e) { form_submitted = 1; } ); - /* set correct required status depending on what we submit - * NB: need to add things to form_category as the JS updating + /* set correct required status depending on what we submit + * NB: need to add things to form_category as the JS updating * of this we do after a map click removes them */ $('#submit_sign_in').click( function(e) { $('#form_category').addClass('required validCategory').removeClass('valid'); $('#form_name').removeClass(); + $('#form_first_name').removeClass(); + $('#form_last_name').removeClass(); + $('#form_fms_extra_title').removeClass(); } ); - $('#submit_register').click( function(e) { + $('#submit_register').click( function(e) { $('#form_category').addClass('required validCategory').removeClass('valid'); $('#form_name').addClass('required validName'); + $('#form_first_name').addClass('required'); + $('#form_last_name').addClass('required'); + $('#form_fms_extra_title').addClass('required'); } ); - $('#problem_submit > input[type="submit"]').click( function(e) { + $('#problem_submit > input[type="submit"]').click( function(e) { $('#form_category').addClass('required validCategory').removeClass('valid'); $('#form_name').addClass('required validName'); + $('#form_first_name').addClass('required'); + $('#form_last_name').addClass('required'); + $('#form_fms_extra_title').addClass('required'); } ); - $('#update_post').click( function(e) { + $('#update_post').click( function(e) { $('#form_name').addClass('required').removeClass('valid'); } ); - $('#email_alert').click(function(e) { - if (!$('#email_alert_box').length) { - return true; - } - e.preventDefault(); - if ($('#email_alert_box').is(':visible')) { - email_alert_close(); - } else { - var pos = $(this).position(); - $('#email_alert_box').css( { 'left': ( pos.left - 20 ) + 'px', 'top': ( pos.top + 20 ) + 'px' } ); - $('#email_alert_box').show('fast'); - $('#alert_rznvy').focus(); - } - }).hover(function() { - window.clearTimeout(timer); - }, function() { - timer = window.setTimeout(email_alert_close, 2000); - }); - - $('#email_alert_box').hover(function() { - window.clearTimeout(timer); - }, function() { - timer = window.setTimeout(email_alert_close, 2000); - }); - - // Using delegate here because we *might* be running under a cobrand which isn't jQuery 1.7+ - // Delegation is necessary because #form_category may be replaced during the lifetime of the page - $("#problem_form").delegate("select#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" }); + if ($('body.frontpage').length) { + $('#postcodeForm').after('<a href="#" id="geolocate_link">… or locate me automatically</a>'); + } else{ + $('#postcodeForm').append('<a href="#" id="geolocate_link">… or locate me automatically</a>'); + } $('#geolocate_link').click(function(e) { + var $link = $(this); e.preventDefault(); // Spinny thing! - $('#geolocate_para').append(' <img src="/i/flower.gif" alt="" align="bottom">'); + if($('.mobile').length){ + $link.append(' <img src="/cobrands/fixmystreet/images/spinner-black.gif" alt="" align="bottom">'); + }else{ + $link.append(' <img src="/cobrands/fixmystreet/images/spinner-yellow.gif" alt="" align="bottom">'); + } geo_position_js.getCurrentPosition(function(pos) { - $('#geolocate_para img').remove(); + $link.find('img').remove(); var latitude = pos.coords.latitude; var longitude = pos.coords.longitude; location.href = '/around?latitude=' + latitude + ';longitude=' + longitude; }, function(err) { - $('#geolocate_para img').remove(); + $link.find('img').remove(); if (err.code == 1) { // User said no + $link.html("You declined; please fill in the box above"); } else if (err.code == 2) { // No position - $('#geolocate_para').html("Could not look up location"); + $link.html("Could not look up location"); } else if (err.code == 3) { // Too long - $('#geolocate_para').html("No result returned"); + $link.html("No result returned"); } else { // Unknown - $('#geolocate_para').html("Unknown error"); + $link.html("Unknown error"); } }, { + enableHighAccuracy: true, timeout: 10000 }); }); } + // Delegation is necessary because #form_category may be replaced during the lifetime of the page + $("#problem_form").on("change.category", "select#form_category", function(){ + var args = { + category: $(this).val() + }; + + if ( typeof fixmystreet !== 'undefined' ) { + args.latitude = fixmystreet.latitude; + args.longitude = fixmystreet.longitude; + } else { + args.latitude = $('input[name="latitude"]').val(); + args.longitude = $('input[name="longitude"]').val(); + } + + $.getJSON('/report/new/category_extras', args, function(data) { + var $category_meta = $('#category_meta'); + if ( data.category_extra ) { + if ( $category_meta.length ) { + $category_meta.html( data.category_extra ); + } else { + $('#form_category_row').after( data.category_extra ); + } + } else { + $category_meta.empty(); + } + }); + }); + }); + +})(jQuery); + diff --git a/web/js/map-OpenLayers.js b/web/js/map-OpenLayers.js index d73e2bfc8..d98994d84 100644 --- a/web/js/map-OpenLayers.js +++ b/web/js/map-OpenLayers.js @@ -7,6 +7,33 @@ function fixmystreet_update_pin(lonlat) { ); document.getElementById('fixmystreet.latitude').value = lonlat.lat || lonlat.y; document.getElementById('fixmystreet.longitude').value = lonlat.lon || lonlat.x; + + $.getJSON('/report/new/ajax', { + latitude: $('#fixmystreet\\.latitude').val(), + longitude: $('#fixmystreet\\.longitude').val() + }, function(data) { + if (data.error) { + if (!$('#side-form-error').length) { + $('<div id="side-form-error"/>').insertAfter($('#side-form')); + } + $('#side-form-error').html('<h1>Reporting a problem</h1><p>' + data.error + '</p>').show(); + $('#side-form').hide(); + return; + } + $('#side-form, #site-logo').show(); + $('#councils_text').html(data.councils_text); + $('#form_category_row').html(data.category); + if ( data.extra_name_info && !$('#form_fms_extra_title').length ) { + // there might be a first name field on some cobrands + var lb = $('#form_first_name').prev(); + if ( lb.length == 0 ) { lb = $('#form_name').prev(); } + lb.before(data.extra_name_info); + } + }); + + if (!$('#side-form-error').is(':visible')) { + $('#side-form, #site-logo').show(); + } } function fixmystreet_activate_drag() { @@ -56,7 +83,11 @@ function fixmystreet_onload() { var bounds = area.getDataExtent(); if (bounds) { var center = bounds.getCenterLonLat(); - fixmystreet.map.setCenter(center, fixmystreet.map.getZoomForExtent(bounds), false, true); + var z = fixmystreet.map.getZoomForExtent(bounds); + if ( z < 13 && $('html').hasClass('mobile') ) { + z = 13; + } + fixmystreet.map.setCenter(center, z, false, true); } }); } @@ -151,7 +182,14 @@ function fixmystreet_onload() { if ( fixmystreet.zoomToBounds ) { var bounds = fixmystreet.markers.getDataExtent(); - if (bounds) { fixmystreet.map.zoomToExtent( bounds ); } + if (bounds) { + var center = bounds.getCenterLonLat(); + var z = fixmystreet.map.getZoomForExtent(bounds); + if ( z < 13 && $('html').hasClass('mobile') ) { + z = 13; + } + fixmystreet.map.setCenter(center, z); + } } $('#hide_pins_link').click(function(e) { @@ -238,8 +276,9 @@ $(function(){ if (fixmystreet.state_map && fixmystreet.state_map == 'full') { // TODO Work better with window resizing, this is pretty 'set up' only at present - var $content = $('.content'), - q = ( $content.offset().left + $content.width() ) / 2; + var $content = $('.content'), mb = $('#map_box'), + q = ( $content.offset().left - mb.offset().left + $content.width() ) / 2; + if (q < 0) { q = 0; } // Need to try and fake the 'centre' being 75% from the left fixmystreet.map.pan(-q, -25, { animate: false }); fixmystreet.map.events.register("movestart", null, function(e){ @@ -421,7 +460,7 @@ OpenLayers.Control.Click = OpenLayers.Class(OpenLayers.Control, { fixmystreet.markers.addFeatures( markers ); fixmystreet_activate_drag(); } - fixmystreet_update_pin(lonlat); + // check to see if markers are visible. We click the // link so that it updates the text in case they go // back @@ -429,23 +468,15 @@ OpenLayers.Control.Click = OpenLayers.Class(OpenLayers.Control, { fixmystreet.state_pins_were_hidden = true; $('#hide_pins_link').click(); } + + // Store pin location in form fields, and check coverage of point + fixmystreet_update_pin(lonlat); + + // Already did this first time map was clicked, so no need to do it again. if (fixmystreet.page == 'new') { return; } - $.getJSON('/report/new/ajax', { - latitude: $('#fixmystreet\\.latitude').val(), - longitude: $('#fixmystreet\\.longitude').val() - }, function(data) { - if (data.error) { - // XXX If they then click back and click somewhere in the area, this error will still show. - $('#side-form').html('<h1>Reporting a problem</h1><p>' + data.error + '</p>'); - return; - } - $('#councils_text').html(data.councils_text); - $('#form_category_row').html(data.category); - }); - $('#side-form, #site-logo').show(); fixmystreet.map.updateSize(); // might have done, and otherwise Firefox gets confused. /* For some reason on IOS5 if you use the jQuery show method it * doesn't display the JS validation error messages unless you do this @@ -468,6 +499,8 @@ OpenLayers.Control.Click = OpenLayers.Class(OpenLayers.Control, { // e.xy is relative to top left of map, which might not be top left of page e.xy.x += bo.left; e.xy.y += bo.top; + + // 24 and 64 is the width and height of the marker pin if (e.xy.y <= o.top || (e.xy.x >= o.left && e.xy.x <= o.left + w + 24 && e.xy.y >= o.top && e.xy.y <= o.top + h + 64)) { // top of the page, pin hidden by header; // or underneath where the new sidebar will appear @@ -476,7 +509,7 @@ OpenLayers.Control.Click = OpenLayers.Class(OpenLayers.Control, { fixmystreet.map.getProjectionObject() ); var p = fixmystreet.map.getViewPortPxFromLonLat(lonlat); - p.x -= ( o.left + w ) / 2; + p.x -= ( o.left - bo.left + w ) / 2; lonlat = fixmystreet.map.getLonLatFromViewPortPx(p); fixmystreet.map.panTo(lonlat); } diff --git a/web/js/map-bing-ol.js b/web/js/map-bing-ol.js index 89b274b18..7d40f8afc 100644 --- a/web/js/map-bing-ol.js +++ b/web/js/map-bing-ol.js @@ -1,3 +1,5 @@ +var tile_base = [ [ '', 'a.', 'b.', 'c.' ], 'http://{S}tilma.mysociety.org/sv' ]; + function set_map_config(perm) { var permalink_id; if ($('#map_permalink').length) { @@ -17,6 +19,9 @@ function set_map_config(perm) { new OpenLayers.Control.Permalink(permalink_id), new OpenLayers.Control.PanZoomFMS({id: 'fms_pan_zoom' }) ]; + if (fixmystreet.map_type) { + tile_base = fixmystreet.map_type; + } fixmystreet.map_type = OpenLayers.Layer.Bing; } @@ -36,7 +41,7 @@ OpenLayers.Layer.Bing = OpenLayers.Class(OpenLayers.Layer.XYZ, { if (z >= 16) { copyrights = 'Contains Ordnance Survey data © Crown copyright and database right 2010'; } else { - logo = '<a href="http://www.bing.com/maps/"><img border=0 src="http://dev.virtualearth.net/Branding/logo_powered_by.png"></a>'; + logo = '<a href="http://www.bing.com/maps/"><img border=0 src="//dev.virtualearth.net/Branding/logo_powered_by.png"></a>'; copyrights = '© 2011 <a href="http://www.bing.com/maps/">Microsoft</a>. © AND, Navteq, Ordnance Survey'; } this.attribution = OpenLayers.String.format(this.attributionTemplate, { @@ -94,20 +99,18 @@ OpenLayers.Layer.Bing = OpenLayers.Class(OpenLayers.Layer.XYZ, { var url; if (z >= 16) { - url = [ - "http://tilma.mysociety.org/sv/${z}/${x}/${y}.png", - "http://a.tilma.mysociety.org/sv/${z}/${x}/${y}.png", - "http://b.tilma.mysociety.org/sv/${z}/${x}/${y}.png", - "http://c.tilma.mysociety.org/sv/${z}/${x}/${y}.png" - ]; + url = []; + for (var i=0; i< tile_base[0].length; i++) { + url.push( tile_base[1].replace('{S}', tile_base[0][i]) + "/${z}/${x}/${y}.png" ); + } } else { var type = ''; if (z > 10) { type = '&productSet=mmOS'; } url = [ - "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 + "//ecn.t0.tiles.virtualearth.net/tiles/r${id}.png?g=701" + type, + "//ecn.t1.tiles.virtualearth.net/tiles/r${id}.png?g=701" + type, + "//ecn.t2.tiles.virtualearth.net/tiles/r${id}.png?g=701" + type, + "//ecn.t3.tiles.virtualearth.net/tiles/r${id}.png?g=701" + type ]; } var s = '' + x + y + z; diff --git a/web/js/modernizr.custom.76759.js b/web/js/modernizr.custom.76759.js deleted file mode 100644 index 20a22d8fa..000000000 --- a/web/js/modernizr.custom.76759.js +++ /dev/null @@ -1,4 +0,0 @@ -/* Modernizr 2.5.3 (Custom Build) | MIT & BSD - * Build: http://www.modernizr.com/download/#-input-shiv-mq-teststyles-load - */ -;window.Modernizr=function(a,b,c){function v(a){i.cssText=a}function w(a,b){return v(prefixes.join(a+";")+(b||""))}function x(a,b){return typeof a===b}function y(a,b){return!!~(""+a).indexOf(b)}function z(a,b,d){for(var e in a){var f=b[a[e]];if(f!==c)return d===!1?a[e]:x(f,"function")?f.bind(d||b):f}return!1}function A(){e.input=function(c){for(var d=0,e=c.length;d<e;d++)n[c[d]]=c[d]in j;return n.list&&(n.list=!!b.createElement("datalist")&&!!a.HTMLDataListElement),n}("autocomplete autofocus list placeholder max min multiple pattern required step".split(" "))}var d="2.5.3",e={},f=b.documentElement,g="modernizr",h=b.createElement(g),i=h.style,j=b.createElement("input"),k={}.toString,l={},m={},n={},o=[],p=o.slice,q,r=function(a,c,d,e){var h,i,j,k=b.createElement("div"),l=b.body,m=l?l:b.createElement("body");if(parseInt(d,10))while(d--)j=b.createElement("div"),j.id=e?e[d]:g+(d+1),k.appendChild(j);return h=["­","<style>",a,"</style>"].join(""),k.id=g,m.innerHTML+=h,m.appendChild(k),l||(m.style.background="",f.appendChild(m)),i=c(k,a),l?k.parentNode.removeChild(k):m.parentNode.removeChild(m),!!i},s=function(b){var c=a.matchMedia||a.msMatchMedia;if(c)return c(b).matches;var d;return r("@media "+b+" { #"+g+" { position: absolute; } }",function(b){d=(a.getComputedStyle?getComputedStyle(b,null):b.currentStyle)["position"]=="absolute"}),d},t={}.hasOwnProperty,u;!x(t,"undefined")&&!x(t.call,"undefined")?u=function(a,b){return t.call(a,b)}:u=function(a,b){return b in a&&x(a.constructor.prototype[b],"undefined")},Function.prototype.bind||(Function.prototype.bind=function(b){var c=this;if(typeof c!="function")throw new TypeError;var d=p.call(arguments,1),e=function(){if(this instanceof e){var a=function(){};a.prototype=c.prototype;var f=new a,g=c.apply(f,d.concat(p.call(arguments)));return Object(g)===g?g:f}return c.apply(b,d.concat(p.call(arguments)))};return e});for(var B in l)u(l,B)&&(q=B.toLowerCase(),e[q]=l[B](),o.push((e[q]?"":"no-")+q));return e.input||A(),v(""),h=j=null,function(a,b){function g(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x<style>"+b+"</style>",d.insertBefore(c.lastChild,d.firstChild)}function h(){var a=k.elements;return typeof a=="string"?a.split(" "):a}function i(a){var b={},c=a.createElement,e=a.createDocumentFragment,f=e();a.createElement=function(a){var e=(b[a]||(b[a]=c(a))).cloneNode();return k.shivMethods&&e.canHaveChildren&&!d.test(a)?f.appendChild(e):e},a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+h().join().replace(/\w+/g,function(a){return b[a]=c(a),f.createElement(a),'c("'+a+'")'})+");return n}")(k,f)}function j(a){var b;return a.documentShived?a:(k.shivCSS&&!e&&(b=!!g(a,"article,aside,details,figcaption,figure,footer,header,hgroup,nav,section{display:block}audio{display:none}canvas,video{display:inline-block;*display:inline;*zoom:1}[hidden]{display:none}audio[controls]{display:inline-block;*display:inline;*zoom:1}mark{background:#FF0;color:#000}")),f||(b=!i(a)),b&&(a.documentShived=b),a)}var c=a.html5||{},d=/^<|^(?:button|form|map|select|textarea)$/i,e,f;(function(){var a=b.createElement("a");a.innerHTML="<xyz></xyz>",e="hidden"in a,f=a.childNodes.length==1||function(){try{b.createElement("a")}catch(a){return!0}var c=b.createDocumentFragment();return typeof c.cloneNode=="undefined"||typeof c.createDocumentFragment=="undefined"||typeof c.createElement=="undefined"}()})();var k={elements:c.elements||"abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video",shivCSS:c.shivCSS!==!1,shivMethods:c.shivMethods!==!1,type:"default",shivDocument:j};a.html5=k,j(b)}(this,b),e._version=d,e.mq=s,e.testStyles=r,e}(this,this.document),function(a,b,c){function d(a){return o.call(a)=="[object Function]"}function e(a){return typeof a=="string"}function f(){}function g(a){return!a||a=="loaded"||a=="complete"||a=="uninitialized"}function h(){var a=p.shift();q=1,a?a.t?m(function(){(a.t=="c"?B.injectCss:B.injectJs)(a.s,0,a.a,a.x,a.e,1)},0):(a(),h()):q=0}function i(a,c,d,e,f,i,j){function k(b){if(!o&&g(l.readyState)&&(u.r=o=1,!q&&h(),l.onload=l.onreadystatechange=null,b)){a!="img"&&m(function(){t.removeChild(l)},50);for(var d in y[c])y[c].hasOwnProperty(d)&&y[c][d].onload()}}var j=j||B.errorTimeout,l={},o=0,r=0,u={t:d,s:c,e:f,a:i,x:j};y[c]===1&&(r=1,y[c]=[],l=b.createElement(a)),a=="object"?l.data=c:(l.src=c,l.type=a),l.width=l.height="0",l.onerror=l.onload=l.onreadystatechange=function(){k.call(this,r)},p.splice(e,0,u),a!="img"&&(r||y[c]===2?(t.insertBefore(l,s?null:n),m(k,j)):y[c].push(l))}function j(a,b,c,d,f){return q=0,b=b||"j",e(a)?i(b=="c"?v:u,a,b,this.i++,c,d,f):(p.splice(this.i++,0,a),p.length==1&&h()),this}function k(){var a=B;return a.loader={load:j,i:0},a}var l=b.documentElement,m=a.setTimeout,n=b.getElementsByTagName("script")[0],o={}.toString,p=[],q=0,r="MozAppearance"in l.style,s=r&&!!b.createRange().compareNode,t=s?l:n.parentNode,l=a.opera&&o.call(a.opera)=="[object Opera]",l=!!b.attachEvent&&!l,u=r?"object":l?"script":"img",v=l?"script":u,w=Array.isArray||function(a){return o.call(a)=="[object Array]"},x=[],y={},z={timeout:function(a,b){return b.length&&(a.timeout=b[0]),a}},A,B;B=function(a){function b(a){var a=a.split("!"),b=x.length,c=a.pop(),d=a.length,c={url:c,origUrl:c,prefixes:a},e,f,g;for(f=0;f<d;f++)g=a[f].split("="),(e=z[g.shift()])&&(c=e(c,g));for(f=0;f<b;f++)c=x[f](c);return c}function g(a,e,f,g,i){var j=b(a),l=j.autoCallback;j.url.split(".").pop().split("?").shift(),j.bypass||(e&&(e=d(e)?e:e[a]||e[g]||e[a.split("/").pop().split("?")[0]]||h),j.instead?j.instead(a,e,f,g,i):(y[j.url]?j.noexec=!0:y[j.url]=1,f.load(j.url,j.forceCSS||!j.forceJS&&"css"==j.url.split(".").pop().split("?").shift()?"c":c,j.noexec,j.attrs,j.timeout),(d(e)||d(l))&&f.load(function(){k(),e&&e(j.origUrl,i,g),l&&l(j.origUrl,i,g),y[j.url]=2})))}function i(a,b){function c(a,c){if(a){if(e(a))c||(j=function(){var a=[].slice.call(arguments);k.apply(this,a),l()}),g(a,j,b,0,h);else if(Object(a)===a)for(n in m=function(){var b=0,c;for(c in a)a.hasOwnProperty(c)&&b++;return b}(),a)a.hasOwnProperty(n)&&(!c&&!--m&&(d(j)?j=function(){var a=[].slice.call(arguments);k.apply(this,a),l()}:j[n]=function(a){return function(){var b=[].slice.call(arguments);a&&a.apply(this,b),l()}}(k[n])),g(a[n],j,b,n,h))}else!c&&l()}var h=!!a.test,i=a.load||a.both,j=a.callback||f,k=j,l=a.complete||f,m,n;c(h?a.yep:a.nope,!!i),i&&c(i)}var j,l,m=this.yepnope.loader;if(e(a))g(a,0,m,0);else if(w(a))for(j=0;j<a.length;j++)l=a[j],e(l)?g(l,0,m,0):w(l)?B(l):Object(l)===l&&i(l,m);else Object(a)===a&&i(a,m)},B.addPrefix=function(a,b){z[a]=b},B.addFilter=function(a){x.push(a)},B.errorTimeout=1e4,b.readyState==null&&b.addEventListener&&(b.readyState="loading",b.addEventListener("DOMContentLoaded",A=function(){b.removeEventListener("DOMContentLoaded",A,0),b.readyState="complete"},0)),a.yepnope=k(),a.yepnope.executeStack=h,a.yepnope.injectJs=function(a,c,d,e,i,j){var k=b.createElement("script"),l,o,e=e||B.errorTimeout;k.src=a;for(o in d)k.setAttribute(o,d[o]);c=j?h:c||f,k.onreadystatechange=k.onload=function(){!l&&g(k.readyState)&&(l=1,c(),k.onload=k.onreadystatechange=null)},m(function(){l||(l=1,c(1))},e),i?k.onload():n.parentNode.insertBefore(k,n)},a.yepnope.injectCss=function(a,c,d,e,g,i){var e=b.createElement("link"),j,c=i?h:c||f;e.href=a,e.rel="stylesheet",e.type="text/css";for(j in d)e.setAttribute(j,d[j]);g||(n.parentNode.insertBefore(e,n),m(c,0))}}(this,document),Modernizr.load=function(){yepnope.apply(window,[].slice.call(arguments,0))};
\ No newline at end of file diff --git a/web/js/modernizr.custom.js b/web/js/modernizr.custom.js new file mode 100644 index 000000000..c4d6ffdfc --- /dev/null +++ b/web/js/modernizr.custom.js @@ -0,0 +1,4 @@ +/* Modernizr 2.5.3 (Custom Build) | MIT & BSD
+ * Build: http://www.modernizr.com/download/#-shiv-load
+ */
+;window.Modernizr=function(a,b,c){function t(a){i.cssText=a}function u(a,b){return t(prefixes.join(a+";")+(b||""))}function v(a,b){return typeof a===b}function w(a,b){return!!~(""+a).indexOf(b)}function x(a,b,d){for(var e in a){var f=b[a[e]];if(f!==c)return d===!1?a[e]:v(f,"function")?f.bind(d||b):f}return!1}var d="2.5.3",e={},f=b.documentElement,g="modernizr",h=b.createElement(g),i=h.style,j,k={}.toString,l={},m={},n={},o=[],p=o.slice,q,r={}.hasOwnProperty,s;!v(r,"undefined")&&!v(r.call,"undefined")?s=function(a,b){return r.call(a,b)}:s=function(a,b){return b in a&&v(a.constructor.prototype[b],"undefined")},Function.prototype.bind||(Function.prototype.bind=function(b){var c=this;if(typeof c!="function")throw new TypeError;var d=p.call(arguments,1),e=function(){if(this instanceof e){var a=function(){};a.prototype=c.prototype;var f=new a,g=c.apply(f,d.concat(p.call(arguments)));return Object(g)===g?g:f}return c.apply(b,d.concat(p.call(arguments)))};return e});for(var y in l)s(l,y)&&(q=y.toLowerCase(),e[q]=l[y](),o.push((e[q]?"":"no-")+q));return t(""),h=j=null,function(a,b){function g(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x<style>"+b+"</style>",d.insertBefore(c.lastChild,d.firstChild)}function h(){var a=k.elements;return typeof a=="string"?a.split(" "):a}function i(a){var b={},c=a.createElement,e=a.createDocumentFragment,f=e();a.createElement=function(a){var e=(b[a]||(b[a]=c(a))).cloneNode();return k.shivMethods&&e.canHaveChildren&&!d.test(a)?f.appendChild(e):e},a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+h().join().replace(/\w+/g,function(a){return b[a]=c(a),f.createElement(a),'c("'+a+'")'})+");return n}")(k,f)}function j(a){var b;return a.documentShived?a:(k.shivCSS&&!e&&(b=!!g(a,"article,aside,details,figcaption,figure,footer,header,hgroup,nav,section{display:block}audio{display:none}canvas,video{display:inline-block;*display:inline;*zoom:1}[hidden]{display:none}audio[controls]{display:inline-block;*display:inline;*zoom:1}mark{background:#FF0;color:#000}")),f||(b=!i(a)),b&&(a.documentShived=b),a)}var c=a.html5||{},d=/^<|^(?:button|form|map|select|textarea)$/i,e,f;(function(){var a=b.createElement("a");a.innerHTML="<xyz></xyz>",e="hidden"in a,f=a.childNodes.length==1||function(){try{b.createElement("a")}catch(a){return!0}var c=b.createDocumentFragment();return typeof c.cloneNode=="undefined"||typeof c.createDocumentFragment=="undefined"||typeof c.createElement=="undefined"}()})();var k={elements:c.elements||"abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video",shivCSS:c.shivCSS!==!1,shivMethods:c.shivMethods!==!1,type:"default",shivDocument:j};a.html5=k,j(b)}(this,b),e._version=d,e}(this,this.document),function(a,b,c){function d(a){return o.call(a)=="[object Function]"}function e(a){return typeof a=="string"}function f(){}function g(a){return!a||a=="loaded"||a=="complete"||a=="uninitialized"}function h(){var a=p.shift();q=1,a?a.t?m(function(){(a.t=="c"?B.injectCss:B.injectJs)(a.s,0,a.a,a.x,a.e,1)},0):(a(),h()):q=0}function i(a,c,d,e,f,i,j){function k(b){if(!o&&g(l.readyState)&&(u.r=o=1,!q&&h(),l.onload=l.onreadystatechange=null,b)){a!="img"&&m(function(){t.removeChild(l)},50);for(var d in y[c])y[c].hasOwnProperty(d)&&y[c][d].onload()}}var j=j||B.errorTimeout,l={},o=0,r=0,u={t:d,s:c,e:f,a:i,x:j};y[c]===1&&(r=1,y[c]=[],l=b.createElement(a)),a=="object"?l.data=c:(l.src=c,l.type=a),l.width=l.height="0",l.onerror=l.onload=l.onreadystatechange=function(){k.call(this,r)},p.splice(e,0,u),a!="img"&&(r||y[c]===2?(t.insertBefore(l,s?null:n),m(k,j)):y[c].push(l))}function j(a,b,c,d,f){return q=0,b=b||"j",e(a)?i(b=="c"?v:u,a,b,this.i++,c,d,f):(p.splice(this.i++,0,a),p.length==1&&h()),this}function k(){var a=B;return a.loader={load:j,i:0},a}var l=b.documentElement,m=a.setTimeout,n=b.getElementsByTagName("script")[0],o={}.toString,p=[],q=0,r="MozAppearance"in l.style,s=r&&!!b.createRange().compareNode,t=s?l:n.parentNode,l=a.opera&&o.call(a.opera)=="[object Opera]",l=!!b.attachEvent&&!l,u=r?"object":l?"script":"img",v=l?"script":u,w=Array.isArray||function(a){return o.call(a)=="[object Array]"},x=[],y={},z={timeout:function(a,b){return b.length&&(a.timeout=b[0]),a}},A,B;B=function(a){function b(a){var a=a.split("!"),b=x.length,c=a.pop(),d=a.length,c={url:c,origUrl:c,prefixes:a},e,f,g;for(f=0;f<d;f++)g=a[f].split("="),(e=z[g.shift()])&&(c=e(c,g));for(f=0;f<b;f++)c=x[f](c);return c}function g(a,e,f,g,i){var j=b(a),l=j.autoCallback;j.url.split(".").pop().split("?").shift(),j.bypass||(e&&(e=d(e)?e:e[a]||e[g]||e[a.split("/").pop().split("?")[0]]||h),j.instead?j.instead(a,e,f,g,i):(y[j.url]?j.noexec=!0:y[j.url]=1,f.load(j.url,j.forceCSS||!j.forceJS&&"css"==j.url.split(".").pop().split("?").shift()?"c":c,j.noexec,j.attrs,j.timeout),(d(e)||d(l))&&f.load(function(){k(),e&&e(j.origUrl,i,g),l&&l(j.origUrl,i,g),y[j.url]=2})))}function i(a,b){function c(a,c){if(a){if(e(a))c||(j=function(){var a=[].slice.call(arguments);k.apply(this,a),l()}),g(a,j,b,0,h);else if(Object(a)===a)for(n in m=function(){var b=0,c;for(c in a)a.hasOwnProperty(c)&&b++;return b}(),a)a.hasOwnProperty(n)&&(!c&&!--m&&(d(j)?j=function(){var a=[].slice.call(arguments);k.apply(this,a),l()}:j[n]=function(a){return function(){var b=[].slice.call(arguments);a&&a.apply(this,b),l()}}(k[n])),g(a[n],j,b,n,h))}else!c&&l()}var h=!!a.test,i=a.load||a.both,j=a.callback||f,k=j,l=a.complete||f,m,n;c(h?a.yep:a.nope,!!i),i&&c(i)}var j,l,m=this.yepnope.loader;if(e(a))g(a,0,m,0);else if(w(a))for(j=0;j<a.length;j++)l=a[j],e(l)?g(l,0,m,0):w(l)?B(l):Object(l)===l&&i(l,m);else Object(a)===a&&i(a,m)},B.addPrefix=function(a,b){z[a]=b},B.addFilter=function(a){x.push(a)},B.errorTimeout=1e4,b.readyState==null&&b.addEventListener&&(b.readyState="loading",b.addEventListener("DOMContentLoaded",A=function(){b.removeEventListener("DOMContentLoaded",A,0),b.readyState="complete"},0)),a.yepnope=k(),a.yepnope.executeStack=h,a.yepnope.injectJs=function(a,c,d,e,i,j){var k=b.createElement("script"),l,o,e=e||B.errorTimeout;k.src=a;for(o in d)k.setAttribute(o,d[o]);c=j?h:c||f,k.onreadystatechange=k.onload=function(){!l&&g(k.readyState)&&(l=1,c(),k.onload=k.onreadystatechange=null)},m(function(){l||(l=1,c(1))},e),i?k.onload():n.parentNode.insertBefore(k,n)},a.yepnope.injectCss=function(a,c,d,e,g,i){var e=b.createElement("link"),j,c=i?h:c||f;e.href=a,e.rel="stylesheet",e.type="text/css";for(j in d)e.setAttribute(j,d[j]);g||(n.parentNode.insertBefore(e,n),m(c,0))}}(this,document),Modernizr.load=function(){yepnope.apply(window,[].slice.call(arguments,0))};
\ No newline at end of file |