Custom HTML elements for the Firefox Marketplace
Перейти к файлу
Davor Spasovski 427c6c6468 update mkt-banner for text-only banner content 2016-04-05 12:26:37 -04:00
gh-pages v0.1.6 be able to have mkt-prompt part of the page 2014-12-23 15:48:47 -08:00
tests Fix mkt-banner not auto-dismissing (bug 1172707) 2015-06-10 13:13:42 -05:00
.gitignore Distribute stylus instead of CSS (bug 1125145) 2015-01-26 12:14:16 -06:00
.travis.yml Testing with karma, mocha and chai 2015-06-10 13:13:25 -05:00
Makefile v0.6.0 less font-weight on banner 2015-03-04 16:35:37 -08:00
README.md Support dismissal of <mkt-banner> per session 2015-01-23 10:11:35 -06:00
bower.json update mkt-banner for text-only banner content 2016-04-05 12:26:37 -04:00
index.html v0.5.1 fix bg color of mkt-prompt 2015-01-27 15:42:58 -08:00
karma.conf.js Testing with karma, mocha and chai 2015-06-10 13:13:25 -05:00
marketplace-elements.js Merge pull request #19 from elysium001/1165656 2015-11-24 10:34:41 -08:00
marketplace-elements.styl update mkt-banner for text-only banner content 2016-04-05 12:26:37 -04:00
package.json Testing with karma, mocha and chai 2015-06-10 13:13:25 -05:00
release.sh Terrible script to release a new version 2014-12-05 16:31:39 -08:00

README.md

marketplace-elements

Custom HTML 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
theme Change the color scheme. May be any of the actions defined in marketplace-frontend or a light variant. Examples: "success" (default) or "success-light". Additionally "firefox" may be specified for a gray banner with the Firefox logo.
dismiss Configure dismissal. Values: "on" (default), "off", "remember", "session".

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.