Custom HTML elements for the Firefox Marketplace
Перейти к файлу
Mark Striemer a9a09bdf13 v0.1.7 2014-12-30 13:29:07 -06:00
dist Build 2014-12-30 13:28:23 -06:00
gh-pages v0.1.6 be able to have mkt-prompt part of the page 2014-12-23 15:48:47 -08:00
.gitignore v0.1.4 add mkt-prompt element 2014-12-19 12:42:59 -08:00
Makefile v0.1.4 add mkt-prompt element 2014-12-19 12:42:59 -08:00
README.md add html5 validation to mkt-prompt, use btn types 2014-12-23 15:48:47 -08:00
bower.json v0.1.7 2014-12-30 13:29:07 -06:00
index.html add html5 validation to mkt-prompt, use btn types 2014-12-23 15:48:47 -08:00
marketplace-elements.js Bubble change events 2014-12-30 13:26:46 -06:00
marketplace-elements.styl add html5 validation to mkt-prompt, use btn types 2014-12-23 15:48:47 -08:00
package.json v0.1.4 add mkt-prompt element 2014-12-19 12:42:59 -08:00
release.sh Terrible script to release a new version 2014-12-05 16:31:39 -08:00

README.md

marketplace-elements

Web component UI elements for Firefox Marketplace.

make install
make
make serve

View Demo

Banner

The banner is used to show messages to users.

<mkt-banner>
  Hey! You should read this.
  <a href="#do-something">Perform some action</a>
  <small>This small text will be hidden on narrow screens.</small>
</mkt-banner>

Configuration

attribute description
success Make it green
dismiss Configure dismissal. Values: "on" (default), "off", "remember".

Segmented

The segmented control acts like a select but provides a horizontal layout.

<mkt-segmented>
    <select>
        <option value="1">One</option>
        <option value="2">Two</option>
        <option value="3" selected>Three</option>
    </select>
</mkt-segmented>
document.querySelector('mkt-segmented').value;  // "3"

Login

A login link. This is pretty basic. It will add the "persona" class to a link.

<mkt-login link>Login!</mkt-login>

Configuration

attribute description
link Required. Link is the only supported type right now.

Prompt

A form that can take the form of a page or as a modal. As a page, it has just a submit button. As a modal, it has a cancel and submit button.

As a page:

<mkt-prompt>
  <form>
    <p>What is your name?</p>
    <textarea name="name"></textarea>
    <div>
      <button>Cancel</button>
      <button>Submit</button>
    </div>
  </form>
</mkt-prompt>

As a modal:

<mkt-prompt data-modal>
...

Events

event description
mkt-prompt-cancel cancel button is clicked
mkt-prompt-submit submit button is clicked. Serialized form data is passed in event details.

Configuration

attribute description
validate function to determine form validity. Defaults to only call form.checkvalidity.