aboutsummaryrefslogtreecommitdiffstats
path: root/web
diff options
context:
space:
mode:
Diffstat (limited to 'web')
-rw-r--r--web/cobrands/fixmystreet.com/posters.js1
-rw-r--r--web/cobrands/fixmystreet/fixmystreet.js67
-rw-r--r--web/cobrands/oxfordshire/layout.scss2
-rw-r--r--web/cobrands/sass/_base.scss9
-rw-r--r--web/iphone/.gitignore1
-rw-r--r--web/iphone/iphone-1start.pngbin192062 -> 0 bytes
-rw-r--r--web/iphone/iphone-2locfound.pngbin191903 -> 0 bytes
-rw-r--r--web/iphone/iphone-3picture.pngbin217150 -> 0 bytes
-rw-r--r--web/iphone/iphone-4subject.pngbin216996 -> 0 bytes
-rw-r--r--web/iphone/iphone-5details.pngbin190020 -> 0 bytes
-rw-r--r--web/iphone/iphone-6emailkeyboard.pngbin266409 -> 0 bytes
-rw-r--r--web/iphone/iphone-7uploading.pngbin215575 -> 0 bytes
-rw-r--r--web/iphone/iphone-8response.pngbin313682 -> 0 bytes
-rw-r--r--web/iphone/iphone-9about.pngbin231665 -> 0 bytes
-rw-r--r--web/iphone/iphone-allready.pngbin217429 -> 0 bytes
-rw-r--r--web/iphone/iphone-contactphoto.pngbin215181 -> 0 bytes
-rw-r--r--web/iphone/iphone-detailsdone.pngbin192072 -> 0 bytes
-rw-r--r--web/iphone/iphone-editname.pngbin262355 -> 0 bytes
-rw-r--r--web/iphone/iphone-editsummary.pngbin263601 -> 0 bytes
-rw-r--r--web/iphone/iphone-editsummary2.pngbin264365 -> 0 bytes
-rw-r--r--web/iphone/iphone-pickpicture1.pngbin200224 -> 0 bytes
-rw-r--r--web/iphone/iphone-pickpicture2.pngbin268191 -> 0 bytes
-rw-r--r--web/iphone/iphone-pickpicture3.pngbin275753 -> 0 bytes
23 files changed, 22 insertions, 58 deletions
diff --git a/web/cobrands/fixmystreet.com/posters.js b/web/cobrands/fixmystreet.com/posters.js
index caf09fd0e..629ffb065 100644
--- a/web/cobrands/fixmystreet.com/posters.js
+++ b/web/cobrands/fixmystreet.com/posters.js
@@ -26,4 +26,5 @@ $.fn.link_track = function(eventCategory, eventAction, eventLabel) {
$(function() {
$("[data-goodielink]").link_track('goodie', 'download', 'goodielink');
+ $('.js-click-select').on('click', function() { this.select(); });
});
diff --git a/web/cobrands/fixmystreet/fixmystreet.js b/web/cobrands/fixmystreet/fixmystreet.js
index 5ab750679..682813070 100644
--- a/web/cobrands/fixmystreet/fixmystreet.js
+++ b/web/cobrands/fixmystreet/fixmystreet.js
@@ -194,6 +194,10 @@ $.extend(fixmystreet.set_up, {
// In case we've come here by clicking back to a form that disabled a submit button
$('input[type=submit]').removeAttr('disabled');
+
+ $('[data-confirm]').on('click', function() {
+ return confirm(this.getAttribute('data-confirm'));
+ });
},
questionnaire: function() {
@@ -217,7 +221,6 @@ $.extend(fixmystreet.set_up, {
jQuery.validator.addMethod('validCategory', function(value, element) {
return this.optional(element) || value != '-- Pick a category --'; }, translation_strings.category );
- var form_submitted = 0;
var submitted = false;
$("form.validate").each(function(){
@@ -228,27 +231,21 @@ $.extend(fixmystreet.set_up, {
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 ) {
- // Different for old/new style design
- if ($('.form-field').length) {
- element.parent('div.form-field').before( error );
- } else {
- element.before( error );
- }
+ 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 );
+ var currScroll = $('#map_sidebar').scrollTop(),
+ pos = $(errorList[0].element).position().top;
+ $('#map_sidebar').scrollTop( currScroll + pos - 120 );
}
this.defaultShowErrors();
submitted = false;
@@ -257,43 +254,17 @@ $.extend(fixmystreet.set_up, {
});
});
- $('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();
- $('#form_first_name').removeClass();
- $('#form_last_name').removeClass();
- $('#form_fms_extra_title').removeClass();
- } );
-
- $('#submit_register').click( function(e) {
+ $('.js-submit_sign_in').click( function(e) {
$('#form_category').addClass('required validCategory').removeClass('valid');
- $('#form_name').addClass('required');
- if ( $('#mapForm').length ) {
- $('#form_name').addClass('validName');
- }
- $('#form_first_name').addClass('required');
- $('#form_last_name').addClass('required');
- $('#form_fms_extra_title').addClass('required');
+ $('.js-form-name').removeClass('required');
} );
- $('#problem_submit > input[type="submit"]').click( function(e) {
+ $('.js-submit_register').click( function(e) {
$('#form_category').addClass('required validCategory').removeClass('valid');
- $('#form_name').addClass('required');
- if ( $('#mapForm').length ) {
- $('#form_name').addClass('validName');
- }
- $('#form_first_name').addClass('required');
- $('#form_last_name').addClass('required');
- $('#form_fms_extra_title').addClass('required');
- } );
-
- $('#update_post').click( function(e) {
- $('#form_name').addClass('required').removeClass('valid');
+ $('.js-form-name').addClass('required');
} );
$('#facebook_sign_in, #twitter_sign_in').click(function(e){
@@ -415,12 +386,6 @@ $.extend(fixmystreet.set_up, {
});
},
- add_validation: function() {
- // Map form doesn't work in some browsers with HTML5 validation and hidden form, so
- // we disable validation by default, and add it in the JS case.
- $('#mapForm').removeAttr('novalidate');
- },
-
contribute_as: function() {
$('.content').on('change', '.js-contribute-as', function(){
var opt = this.options[this.selectedIndex],
@@ -856,6 +821,13 @@ $.extend(fixmystreet.set_up, {
}
add_handlers( $('.problem-header'), 'problem' );
add_handlers( $('.item-list__item--updates'), 'update' );
+ },
+
+ response_templates: function() {
+ $('.js-template-name').change(function() {
+ var $this = $(this);
+ $('#' + $this.data('for')).val($this.val());
+ });
}
});
@@ -1079,6 +1051,7 @@ fixmystreet.display = {
fixmystreet.set_up.dropzone($sideReport);
fixmystreet.set_up.form_focus_triggers();
fixmystreet.set_up.moderation();
+ fixmystreet.set_up.response_templates();
window.selected_problem_id = reportId;
var marker = fixmystreet.maps.get_marker_by_id(reportId);
diff --git a/web/cobrands/oxfordshire/layout.scss b/web/cobrands/oxfordshire/layout.scss
index c9783b14d..7417b7081 100644
--- a/web/cobrands/oxfordshire/layout.scss
+++ b/web/cobrands/oxfordshire/layout.scss
@@ -62,7 +62,7 @@ body.twothirdswidthpage {
// To prevent font size larger interfering with the fixed Oxfordshire layout
.container { width: auto; }
-.full-width { width: 464px; }
+body:not(.admin) .full-width { width: 464px; }
.shadow-wrap { width: 464px; }
.content { width: 432px; }
diff --git a/web/cobrands/sass/_base.scss b/web/cobrands/sass/_base.scss
index 576538daa..d1fdec343 100644
--- a/web/cobrands/sass/_base.scss
+++ b/web/cobrands/sass/_base.scss
@@ -458,15 +458,6 @@ ul.error {
@include border-radius(0.25em);
}
-// don't display valid error boxes as now the page jump
-// won't be until the user submits, which is fine
-div.label-valid,
-p.label-valid {
- display:none !important;
- visibility: hidden;
-}
-
-
/*** LAYOUT ***/
diff --git a/web/iphone/.gitignore b/web/iphone/.gitignore
deleted file mode 100644
index 973f53659..000000000
--- a/web/iphone/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-/_Inline
diff --git a/web/iphone/iphone-1start.png b/web/iphone/iphone-1start.png
deleted file mode 100644
index 1d804af8d..000000000
--- a/web/iphone/iphone-1start.png
+++ /dev/null
Binary files differ
diff --git a/web/iphone/iphone-2locfound.png b/web/iphone/iphone-2locfound.png
deleted file mode 100644
index bade44fd9..000000000
--- a/web/iphone/iphone-2locfound.png
+++ /dev/null
Binary files differ
diff --git a/web/iphone/iphone-3picture.png b/web/iphone/iphone-3picture.png
deleted file mode 100644
index 3bcab408a..000000000
--- a/web/iphone/iphone-3picture.png
+++ /dev/null
Binary files differ
diff --git a/web/iphone/iphone-4subject.png b/web/iphone/iphone-4subject.png
deleted file mode 100644
index cd1588b30..000000000
--- a/web/iphone/iphone-4subject.png
+++ /dev/null
Binary files differ
diff --git a/web/iphone/iphone-5details.png b/web/iphone/iphone-5details.png
deleted file mode 100644
index c05ec1626..000000000
--- a/web/iphone/iphone-5details.png
+++ /dev/null
Binary files differ
diff --git a/web/iphone/iphone-6emailkeyboard.png b/web/iphone/iphone-6emailkeyboard.png
deleted file mode 100644
index 32c7f690f..000000000
--- a/web/iphone/iphone-6emailkeyboard.png
+++ /dev/null
Binary files differ
diff --git a/web/iphone/iphone-7uploading.png b/web/iphone/iphone-7uploading.png
deleted file mode 100644
index 05bfde053..000000000
--- a/web/iphone/iphone-7uploading.png
+++ /dev/null
Binary files differ
diff --git a/web/iphone/iphone-8response.png b/web/iphone/iphone-8response.png
deleted file mode 100644
index a6a25bcbd..000000000
--- a/web/iphone/iphone-8response.png
+++ /dev/null
Binary files differ
diff --git a/web/iphone/iphone-9about.png b/web/iphone/iphone-9about.png
deleted file mode 100644
index b80f1972b..000000000
--- a/web/iphone/iphone-9about.png
+++ /dev/null
Binary files differ
diff --git a/web/iphone/iphone-allready.png b/web/iphone/iphone-allready.png
deleted file mode 100644
index ae193feb1..000000000
--- a/web/iphone/iphone-allready.png
+++ /dev/null
Binary files differ
diff --git a/web/iphone/iphone-contactphoto.png b/web/iphone/iphone-contactphoto.png
deleted file mode 100644
index 440511138..000000000
--- a/web/iphone/iphone-contactphoto.png
+++ /dev/null
Binary files differ
diff --git a/web/iphone/iphone-detailsdone.png b/web/iphone/iphone-detailsdone.png
deleted file mode 100644
index c7de03578..000000000
--- a/web/iphone/iphone-detailsdone.png
+++ /dev/null
Binary files differ
diff --git a/web/iphone/iphone-editname.png b/web/iphone/iphone-editname.png
deleted file mode 100644
index 5807235d3..000000000
--- a/web/iphone/iphone-editname.png
+++ /dev/null
Binary files differ
diff --git a/web/iphone/iphone-editsummary.png b/web/iphone/iphone-editsummary.png
deleted file mode 100644
index 251fad6df..000000000
--- a/web/iphone/iphone-editsummary.png
+++ /dev/null
Binary files differ
diff --git a/web/iphone/iphone-editsummary2.png b/web/iphone/iphone-editsummary2.png
deleted file mode 100644
index 7019071c4..000000000
--- a/web/iphone/iphone-editsummary2.png
+++ /dev/null
Binary files differ
diff --git a/web/iphone/iphone-pickpicture1.png b/web/iphone/iphone-pickpicture1.png
deleted file mode 100644
index 8f55bff93..000000000
--- a/web/iphone/iphone-pickpicture1.png
+++ /dev/null
Binary files differ
diff --git a/web/iphone/iphone-pickpicture2.png b/web/iphone/iphone-pickpicture2.png
deleted file mode 100644
index 582673abd..000000000
--- a/web/iphone/iphone-pickpicture2.png
+++ /dev/null
Binary files differ
diff --git a/web/iphone/iphone-pickpicture3.png b/web/iphone/iphone-pickpicture3.png
deleted file mode 100644
index e7960798f..000000000
--- a/web/iphone/iphone-pickpicture3.png
+++ /dev/null
Binary files differ