Code Monkey home page Code Monkey logo

comment-widget's Introduction

Regulations.gov Comment Widget

Comment widget that is accessible to the public to embed on webpages.


Background

Currently, media channels and other interested parties referring to a Rule/Notice only have the option to provide the public with Regulations.gov homepage link instead of linking to the specific comment form page. Providing the interested parties with a widget will make it easier for the public to submit comments to the specific ruling mentioned in the articles, blog or other types of webpages.

Usage

The associated files are hosted via CDN. Embed code is generated once a registered user provides:

  • API Key
  • Document ID

Example of modal trigger code:

  <button id="regsgov-trigger">Comment Now!</button>
  1. Example of form embed code (with data attributes):
  <script src="https://cdn.jsdelivr.net/regsgov-comment-widget/latest/widget.min.js"></script>
  <div id="regsgov-widget" data-apikey="DEMO_KEY" data-docid="DARS_FRDOC_0001-0926" style="display: none;"/>

Include data attributes to be parsed by widget.min.js. This setup is ideal for clients who have relatively simple requirements (display one trigger & comment form on page) and whose CMS will allow for data attributes in the DOM.

  1. Example of form embed code (with options):
  <script src="https://cdn.jsdelivr.net/regsgov-comment-widget/latest/widget.min.js"></script>
  <script>  window.onload = function(){
      RegsgovCommentWidget.init({apikey: "DEMO_KEY",
      docid: "DARS_FRDOC_0001-0926",
      triggerElement: "#regsgov-trigger"});
  </script>

Include an options object to be parsed by widget.min.js. This setup is ideal for more complex requirements in which, clients need to display more than one unique trigger & comment form per page. Multiple forms referring to different FR documents can be embedded. Although, only one modal window can be displayed at a time. This usage is also good for clients whose CMS does not allow for data attributes in the DOM.

Notes on usage

The embedded div code cannot be child to a div (from the host page) that has style set to "overflow:hidden" as it will cause the widget to be clipped. The modal trigger code can be placed anywhere but, the embedded div must be placed in a parent div that does not have overflow set to hidden.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.