Sha256: 568f476a3877d10a09e5b82fa959ff4b7e8d254d6889649531e87bf5bf2e1f44

Contents?: true

Size: 690 Bytes

Versions: 17

Compression:

Stored size: 690 Bytes

Contents

# frozen_string_literal: true

module Katalyst
  module GOVUK
    module Formbuilder
      module Frontend
        # rubocop:disable Rails/OutputSafety
        def govuk_formbuilder_init
          tag.script type: "module", nonce: request.content_security_policy_nonce do
            <<~JS.html_safe
              document.body.classList.toggle("js-enabled", true);
              document.body.classList.toggle("govuk-frontend-supported", ('noModule' in HTMLScriptElement.prototype));
              import {initAll} from "@katalyst/govuk-formbuilder";
              initAll();
            JS
          end
        end
        # rubocop:enable Rails/OutputSafety
      end
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
katalyst-govuk-formbuilder-1.13.0 lib/katalyst/govuk/formbuilder/frontend.rb
katalyst-govuk-formbuilder-1.12.1 lib/katalyst/govuk/formbuilder/frontend.rb
katalyst-govuk-formbuilder-1.12.0 lib/katalyst/govuk/formbuilder/frontend.rb
katalyst-govuk-formbuilder-1.11.0 lib/katalyst/govuk/formbuilder/frontend.rb
katalyst-govuk-formbuilder-1.10.2 lib/katalyst/govuk/formbuilder/frontend.rb
katalyst-govuk-formbuilder-1.10.1 lib/katalyst/govuk/formbuilder/frontend.rb
katalyst-govuk-formbuilder-1.10.0 lib/katalyst/govuk/formbuilder/frontend.rb
katalyst-govuk-formbuilder-1.9.4 lib/katalyst/govuk/formbuilder/frontend.rb
katalyst-govuk-formbuilder-1.9.3 lib/katalyst/govuk/formbuilder/frontend.rb
katalyst-govuk-formbuilder-1.9.2 lib/katalyst/govuk/formbuilder/frontend.rb
katalyst-govuk-formbuilder-1.9.1 lib/katalyst/govuk/formbuilder/frontend.rb
katalyst-govuk-formbuilder-1.9.0 lib/katalyst/govuk/formbuilder/frontend.rb
katalyst-govuk-formbuilder-1.8.1 lib/katalyst/govuk/formbuilder/frontend.rb
katalyst-govuk-formbuilder-1.8.0 lib/katalyst/govuk/formbuilder/frontend.rb
katalyst-govuk-formbuilder-1.7.1 lib/katalyst/govuk/formbuilder/frontend.rb
katalyst-govuk-formbuilder-1.7.0 lib/katalyst/govuk/formbuilder/frontend.rb
katalyst-govuk-formbuilder-1.6.0 lib/katalyst/govuk/formbuilder/frontend.rb