Skip to content

Commit

Permalink
update other components
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickpatrickpatrick committed Nov 6, 2023
1 parent e4bd3c1 commit 9a8bd56
Show file tree
Hide file tree
Showing 26 changed files with 37 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
// = require dist/govuk/components/button/button.bundle.js
window.GOVUK = window.GOVUK || {}
window.GOVUK.Modules = window.GOVUK.Modules || {}
window.GOVUK.Modules.GovukButton = window.GOVUKFrontend.Button
window.GOVUK.Modules.GovukButton = window.GOVUKFrontend.Button.Button
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
// = require dist/govuk/components/character-count/character-count.bundle.js
window.GOVUK = window.GOVUK || {}
window.GOVUK.Modules = window.GOVUK.Modules || {}
window.GOVUK.Modules.GovukCharacterCount = window.GOVUKFrontend.CharacterCount
window.GOVUK.Modules.GovukCharacterCount = window.GOVUKFrontend.CharacterCount.CharacterCount
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
// = require dist/govuk/components/checkboxes/checkboxes.bundle.js
window.GOVUK = window.GOVUK || {}
window.GOVUK.Modules = window.GOVUK.Modules || {}
window.GOVUK.Modules.GovukCheckboxes = window.GOVUKFrontend.Checkboxes;
window.GOVUK.Modules.GovukCheckboxes = window.GOVUKFrontend.Checkboxes.Checkboxes;

(function (Modules) {
function GemCheckboxes ($module) {
this.$module = $module
this.$checkboxes = this.$module.querySelectorAll('input[type=checkbox]')
this.$nestedCheckboxes = this.$module.querySelectorAll('[data-nested=true] input[type=checkbox]')

this.init();
}

GemCheckboxes.prototype.init = function () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
this.$guidance = this.$module.querySelector('.gem-c-contextual-guidance__wrapper')
this.$inputId = this.$guidance.getAttribute('for')
this.$input = this.$module.querySelector('#' + this.$inputId)

this.init();
}

ContextualGuidance.prototype.init = function () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
this.$module = $module
this.$module.cookieBannerConfirmationMessage = this.$module.querySelector('.gem-c-cookie-banner__confirmation')
this.$module.cookieBannerConfirmationMessageText = this.$module.querySelector('.gem-c-cookie-banner__confirmation-message')
this.init();
}

CookieBanner.prototype.init = function () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
this.$module = $module
this.$input = this.$module.querySelector('.gem-c-input')
this.$copyButton = this.$module.querySelector('.gem-c-button')
this.init();
}

CopyToClipboard.prototype.init = function () {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
window.GOVUK = window.GOVUK || {}
window.GOVUK.Modules = window.GOVUK.Modules || {}


// this now doesn't use any JS...
// might need to reimplement this...

(function (Modules) {
function GemDetails ($module) {
this.$module = $module
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
// = require dist/govuk/components/error-summary/error-summary.bundle.js
window.GOVUK = window.GOVUK || {}
window.GOVUK.Modules = window.GOVUK.Modules || {}
window.GOVUK.Modules.GovukErrorSummary = window.GOVUKFrontend.ErrorSummary
window.GOVUK.Modules.GovukErrorSummary = window.GOVUKFrontend.ErrorSummary.ErrorSummary
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
this.jshiddenClass = 'js-hidden'
this.whatDoingInput = this.$module.querySelector('[name=what_doing]')
this.whatWrongInput = this.$module.querySelector('[name=what_wrong]')

this.init();
}

Feedback.prototype.init = function () {
Expand Down Expand Up @@ -73,6 +75,7 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
} else {
gaClientId = window.GOVUK.cookie('_ga').split('.').slice(-2).join('.')
}

this.setHiddenValuesNotUsefulForm(gaClientId)
}.bind(this))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
(function (Modules) {
function Govspeak ($module) {
this.$module = $module
this.init();
}

Govspeak.prototype.init = function () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
function ImageCard ($module) {
this.$module = $module
this.$module.youtubeLink = this.$module.querySelector('.gem-c-image-card__image-wrapper div')
this.init();
}

ImageCard.prototype.init = function () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
this.$closeLink = this.$module.querySelector('.js-dismiss-link')
this.$campaignName = this.$module.getAttribute('data-intervention-name')
this.$campaignCookie = window.GOVUK.cookie('intervention_campaign') || ''
this.init();
}

Intervention.prototype.init = function () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
// = require dist/govuk/components/header/header.bundle.js
window.GOVUK = window.GOVUK || {}
window.GOVUK.Modules = window.GOVUK.Modules || {}
window.GOVUK.Modules.GovukHeader = window.GOVUKFrontend.Header
window.GOVUK.Modules.GovukHeader = window.GOVUKFrontend.Header.Header
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
)

this.hiddenButtons = this.$module.querySelectorAll('button[hidden]')

this.init();
}

SuperNavigationMegaMenu.prototype.buttonHandler = function (event) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
(function (Modules) {
function Metadata ($module) {
this.$module = $module
this.init();
}

Metadata.prototype.init = function () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
this.$closeButton = this.$module.querySelector('.gem-c-modal-dialogue__close-button')
this.$html = document.querySelector('html')
this.$body = document.querySelector('body')
this.init();
}

ModalDialogue.prototype.init = function () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
if (checkedString) {
this.attachCheckedCounter(checkedString)
}

this.init();
}

OptionSelect.prototype.toggleVisibility = function (isTabletOrLarger) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
(function (Modules) {
function PrintLink ($module) {
this.$module = $module
this.init();
}

PrintLink.prototype.init = function () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@

window.GOVUK = window.GOVUK || {}
window.GOVUK.Modules = window.GOVUK.Modules || {}
window.GOVUK.Modules.GovukRadios = window.GOVUKFrontend.Radios
window.GOVUK.Modules.GovukRadios = window.GOVUKFrontend.Radios.Radios
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
this.$module = $module
this.$upButtons = this.$module.querySelectorAll('.js-reorderable-list-up')
this.$downButtons = this.$module.querySelectorAll('.js-reorderable-list-down')
this.init();
}

ReorderableList.prototype.init = function () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
function ShowPassword ($module) {
this.$module = $module
this.input = this.$module.querySelector('.gem-c-input')
this.init();
}

ShowPassword.prototype.init = function () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
this.personalisationEndpoint = '/api/personalisation/check-email-subscription?base_path=' + this.basePath
// This attribute is passed through to the personalisation API to ensure the updated button has the same button_location for analytics
if (this.buttonLocation) this.personalisationEndpoint += '&button_location=' + this.buttonLocation

this.init();
}

SinglePageNotificationButton.prototype.init = function () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@

window.GOVUK = window.GOVUK || {}
window.GOVUK.Modules = window.GOVUK.Modules || {}
window.GOVUK.Modules.GovukSkipLink = window.GOVUKFrontend.SkipLink
window.GOVUK.Modules.GovukSkipLink = window.GOVUKFrontend.SkipLink.SkipLink
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@


window.GOVUK = window.GOVUK || {}
window.GOVUK.Modules = window.GOVUK.Modules || {};

Expand All @@ -14,6 +12,7 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
this.$module.activeStepClass = 'gem-c-step-nav__step--active'
this.$module.activeLinkHref = '#content'
this.$module.uniqueId = false
this.init();
}

Gemstepnav.prototype.init = function () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
for (var i = 0; i < this.tableRows.length; i++) {
this.tableRowsContent.push(this.tableRows[i].textContent.toUpperCase())
}
this.init();
}

Table.prototype.init = function () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@

window.GOVUK = window.GOVUK || {}
window.GOVUK.Modules = window.GOVUK.Modules || {}
window.GOVUK.Modules.GovukTabs = window.GOVUKFrontend.Tabs
window.GOVUK.Modules.GovukTabs = window.GOVUKFrontend.Tabs.Tabs

0 comments on commit 9a8bd56

Please sign in to comment.