Skip to content

Commit

Permalink
Merge pull request #832 from alphagov/add-september-survey
Browse files Browse the repository at this point in the history
Add September small survey
  • Loading branch information
kalleth authored Sep 5, 2016
2 parents 471e442 + b1d00bf commit 7110563
Showing 1 changed file with 12 additions and 25 deletions.
37 changes: 12 additions & 25 deletions app/assets/javascripts/surveys.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,31 +23,18 @@
},
smallSurveys: [
{
url: 'https://www.surveymonkey.com/s/2MRDLTW',
identifier: 'user_satisfaction_survey',
template: TEMPLATE,
frequency: 10,
activeWhen: function() {
function breadcrumbMatches() {
var text = $('#global-breadcrumb').text() || "";
return (/Education/i.test(text) || /Schools/i.test(text) || /Childcare/i.test(text));
}

function sectionMatches() {
var sectionName = $('meta[name="govuk:section"]').attr('content');
return (sectionName === 'education and learning' || sectionName === 'childcare and parenting');
}

function organisationMatches() {
var orgMatchingExpr = /<D6>|<D106>|<D109>|<EA243>|<EA86>|<EA242>|<EA541>/;
var metaText = $('meta[name="govuk:analytics:organisations"]').attr('content') || "";
return orgMatchingExpr.test(metaText);
}

return (sectionMatches() || breadcrumbMatches() || organisationMatches());
},
startTime: new Date("August 9, 2016").getTime(),
endTime: new Date("August 10, 2016 23:59:59").getTime()
url: 'https://www.surveymonkey.co.uk/r/GZ2JDHZ',
identifier: 'three_word_survey',
template: '<section id="user-satisfaction-survey" class="visible" aria-hidden="false">' +
' <div class="wrapper">' +
' <h1>How do you feel about your visit to GOV.UK today?</h1>' +
' <p class="right"><a href="#survey-no-thanks" id="survey-no-thanks">No thanks</a></p>' +
' <p><a href="javascript:void()" id="take-survey" target="_blank">Take the 1 question survey</a> This will open a short survey on another website</p>' +
' </div>' +
'</section>',
startTime: new Date("September 7, 2016").getTime(),
endTime: new Date("September 8, 2016 23:59:59").getTime(),
frequency: 50,
}
],

Expand Down

0 comments on commit 7110563

Please sign in to comment.