diff options
Diffstat (limited to 'web')
-rw-r--r-- | web/cobrands/bromley/base.scss | 22 | ||||
-rw-r--r-- | web/cobrands/bromley/bromley-logo.jpg | bin | 0 -> 20898 bytes | |||
-rw-r--r-- | web/cobrands/bromley/bromley-logo.s.jpg | bin | 0 -> 5908 bytes | |||
-rw-r--r-- | web/cobrands/bromley/bromley.scss | 108 | ||||
-rw-r--r-- | web/cobrands/bromley/favicon.ico | bin | 0 -> 61798 bytes | |||
-rw-r--r-- | web/cobrands/bromley/fms-logo.png | bin | 0 -> 4740 bytes | |||
-rw-r--r-- | web/cobrands/bromley/layout.scss | 102 | ||||
-rw-r--r-- | web/cobrands/bromley/tab-blue.png | bin | 0 -> 826 bytes | |||
-rw-r--r-- | web/cobrands/fixmystreet/_base.scss | 60 | ||||
-rw-r--r-- | web/cobrands/fixmystreet/_layout.scss | 73 | ||||
-rw-r--r-- | web/cobrands/fixmystreet/fixmystreet.js | 234 | ||||
-rw-r--r-- | web/css/core.scss | 6 | ||||
-rw-r--r-- | web/js/fixmystreet-old-box.js | 39 | ||||
-rw-r--r-- | web/js/fixmystreet.js | 171 | ||||
-rw-r--r-- | web/js/map-OpenLayers.js | 14 | ||||
-rw-r--r-- | web/js/modernizr.custom.76759.js | 4 | ||||
-rw-r--r-- | web/js/modernizr.custom.js | 4 |
17 files changed, 509 insertions, 328 deletions
diff --git a/web/cobrands/bromley/base.scss b/web/cobrands/bromley/base.scss index 4594f832f..710078118 100644 --- a/web/cobrands/bromley/base.scss +++ b/web/cobrands/bromley/base.scss @@ -5,3 +5,25 @@ @import "../fixmystreet/_base"; +// 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; +} + 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..0f4879bef --- /dev/null +++ b/web/cobrands/bromley/bromley.scss @@ -0,0 +1,108 @@ +/* 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"; + +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('http://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('http://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('http://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('http://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('http://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, image removed from background, width removed for no scrollbar, fixed font size. +#bromley-footer { background: #666; clear: both; padding:15px 15px 50px; margin-left:-15px; color:#fff; font-size:11px;} +#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 { + #search input { padding: 8px 5px 2px; } + #search input.button { padding: 0; width: 68px; line-height: 24px; } + input.button { overflow: visible; width: 1%; } +} +.ie7 { + #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; } +.main-menu ul { margin: 0; } +.main-menu li { list-style-type: none; } +#search input { display: inline; margin: 0; @include border-radius(0em); } +#search input.button { font-weight: normal; text-transform: none; } +#bromley-footer { margin: 2em 0 0; } +#bromley-footer .footer-nav li { list-style-type: none; } +#bromley-footer p { margin: 0; } + +#bromley-powered-by { + text-align: right; +} + +#main-menu { + text-align: center; + margin: 2em 0; + padding: 0; + li { + margin: 0; + padding: 0; + display: inline; + a, span { + padding: 1em; + color: #000; + background: #eef; + @include background(linear-gradient(#eef, #eee)); + } + span { + text-decoration: underline; + } + } + a:hover { + background: #ccf; + } +} + 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/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..6c2ded2fc 100644 --- a/web/cobrands/bromley/layout.scss +++ b/web/cobrands/bromley/layout.scss @@ -1,11 +1,113 @@ @import "_colours"; @import "../fixmystreet/_layout"; +// So that map appears underneath the header +.wrapper { + position: relative; +} +.ie6, .ie7 { + .wrapper { + padding-top: 1em; + } +} + body { background: #fff; } #front-main { background: $primary; + // layout sets this because base has it slightly lighter + h2 { + color: $primary_text; + } +} + +// Don't want gap that normal site has +body.frontpage { + .table-cell { + .content { + margin-top: 0; + } + } +} +#user-meta { + p { + top: -1em; + } +} +body.frontpage { + #user-meta { + p { + top: -2em; + } + } +} + +// Don't want FixMyStreet logo on desktop, and we have a skip to content in +// Bromley header +#site-header { + display: none; +} + +// Currently hiding, but do want some internal navigation somewhere at the end +.nav-wrapper { + display: none; +} + +// White background, so no shadow needed. +.content { + margin-top: 1em; + @include box-shadow(none); +} +.ie6, .ie7, .ie8 { + .content { + border: none; + } +} +// Except on map pages +body.mappage .content { + @include box-shadow(0px 0px 6px 1px #000); +} +.ie6, .ie7, .ie8 { + body.mappage .content { + border: solid 1px #666; + } +} + +// As map can scroll and isn't at the top, give it an edge +#map_box { + border-top: solid 1px #999; + border-bottom: solid 1px #999; +} + +// Perhaps fix map location (should be in central?) +.ie6 #map_box, .ie7 #map_box { + right: -30em; + top: 0; +} + +// Fix location of aside sidebar +body.twothirdswidthpage { + .content { + aside { + @include box-shadow(none); + } + .sticky-sidebar { + aside { + position: absolute; + top: 0; + } + } + } +} +@media only screen and (min-width: 48em) and (max-width: 61em) { + body.twothirdswidthpage { + .content { + .sticky-sidebar { + top: auto; + } + } + } } 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 4202564f7..5fd87a454 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; } @@ -149,10 +146,9 @@ img { select, input, textarea { font-size: 99%; - max-width: 95%; + max-width: 100%; } - // links a, a:visited { @@ -244,10 +240,19 @@ 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%; + } } textarea { @@ -291,7 +296,6 @@ label{ margin: 0 -2em 0.25em -2em; background:#eeeeee; padding:1em 2em 1em 2em; - max-width:26em; >input[type=text] { margin-bottom:1em; } @@ -316,6 +320,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 { @@ -347,8 +359,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, @@ -361,7 +379,6 @@ ul.error { background:#ff0000; color:#fff; padding:0 0.5em; - margin:0 0 0 -0.5em; @include border-radius(0.25em); } @@ -447,7 +464,8 @@ p.label-valid { &#mysoc-menu{ li { a { - background:$primary; + color: $primary_text; + background: $primary; &#mysoc-logo { background-image:url('/cobrands/fixmystreet/images/sprite.png'); background-repeat:no-repeat; @@ -472,7 +490,8 @@ p.label-valid { #user-meta { p { position: relative; - background:$primary; + color: $primary_text; + background: $primary; padding:1em 6em 1em 1em; a { position: absolute; @@ -893,7 +912,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; @@ -1273,7 +1292,8 @@ table.nicetable { .promo { @extend .full-width; - background:$primary; + color: $primary_text; + background: $primary; padding:1em; margin-bottom:1em; overflow:hidden; @@ -1286,10 +1306,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; } } } @@ -1320,7 +1340,8 @@ table.nicetable { } a { @include inline-block; - background:$primary; + color: $primary_text; + background: $primary; padding-left:0.5em; padding-right:0.5em; color:#1a1a1a; @@ -1334,7 +1355,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 @@ -1353,6 +1374,7 @@ table.nicetable { /* Front page */ #front-main { text-align:center; + margin: 1em; h2 { font: { style:italic; @@ -1361,6 +1383,9 @@ table.nicetable { } color:#4d4d4d; } + p { + margin: 0.5em 0 0; + } #postcodeForm { @extend .full-width; padding:1em; @@ -1447,7 +1472,6 @@ table.nicetable { #front-recently { .issue-list-a { border-bottom:none; - margin-bottom:0; } } diff --git a/web/cobrands/fixmystreet/_layout.scss b/web/cobrands/fixmystreet/_layout.scss index 687b3dbcc..57b26f42d 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; @@ -210,7 +211,7 @@ h1 { .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; } @@ -702,18 +703,13 @@ input[type=text], input[type=password], input[type=email], textarea{ - width: 25em; + max-width: 25em; } -.form-box { - max-width:25em; -} - /* form errors */ div.form-error, p.form-error { display:block; - width:24.7em; } input.form-error, @@ -743,7 +739,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. } } @@ -782,19 +778,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; @@ -807,7 +799,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 { @@ -833,7 +825,7 @@ body.frontpage { .ie6, .ie7 { body.frontpage { #site-header { - height:3em; + height:4em; } #site-logo { top:-1em; @@ -846,24 +838,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; @@ -876,6 +857,7 @@ body.frontpage { #postcodeForm { background:none; overflow:hidden; + padding-bottom: 0; margin-right:0.5em; label { margin:0.5em 0; @@ -889,8 +871,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; @@ -901,27 +883,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 0db8334fb..47f5da820 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,23 +103,52 @@ $(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(); + if (cobrand == 'bromley') { + var $window = $(window), $content = $('.content'), o = $content.offset(); + if ($html.hasClass('ie6')) { + $('#map_box').prependTo('.wrapper').css({ + zIndex: 0, position: 'absolute', + right: 0, top: '1em', + width: $window.width() - o.left - $content.outerWidth(), + height: $window.height() - o.top + 32, + margin: 0 + }); + } else { + var map_height = $window.height() - o.top; + $('#map_box').prependTo('.wrapper').css({ + zIndex: 0, position: 'fixed', + right: 0, top: o.top, bottom: 0, left: 'auto', + width: $window.width() - o.left - $content.outerWidth(), + height: map_height, + margin: 0 + }); + } + } else 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 + }); } - $('#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 - }); if (typeof fixmystreet !== 'undefined') { + if (cobrand == 'bromley') { + $('#bromley-footer').hide(); + } fixmystreet.state_map = 'full'; } if (typeof fixmystreet !== 'undefined' && fixmystreet.page == 'around') { // Remove full-screen-ness - $('#site-header').show(); + if (cobrand != 'bromley') { + $('#site-header').show(); + } $('#fms_pan_zoom').css({ top: '4.75em !important' }); $('.big-green-banner') .removeClass('mobile-map-banner') @@ -154,141 +158,7 @@ $(function(){ $('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 @@ -572,7 +442,11 @@ $.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); } } 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/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 1574754c9..9d8974fb6 100644 --- a/web/js/map-OpenLayers.js +++ b/web/js/map-OpenLayers.js @@ -236,8 +236,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){ @@ -441,6 +442,11 @@ OpenLayers.Control.Click = OpenLayers.Class(OpenLayers.Control, { } $('#councils_text').html(data.councils_text); $('#form_category_row').html(data.category); + if ( data.extra_name_info ) { + // there might be a first name field on some cobrands + var lb = $('#form_first_name').prev() || $('#form_name').prev(); + lb.before(data.extra_name_info); + } }); $('#side-form, #site-logo').show(); @@ -474,7 +480,11 @@ OpenLayers.Control.Click = OpenLayers.Class(OpenLayers.Control, { fixmystreet.map.getProjectionObject() ); var p = fixmystreet.map.getViewPortPxFromLonLat(lonlat); +<<<<<<< HEAD + p.x -= ( o.left - bo.left + w ) / 2; +======= p.x -= ( o.left + w ) / 2; +>>>>>>> send-report-rewrite lonlat = fixmystreet.map.getLonLatFromViewPortPx(p); fixmystreet.map.panTo(lonlat); } 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 |