plastiq-zeroclipboard
zeroclipboard for plastiq
Last updated 5 years ago by refractalize .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install plastiq-zeroclipboard 
SYNC missed versions from official npm registry.

ZeroClipboard for Plastiq

A plastiq component for ZeroClipboard.

var plastiq = require('plastiq');
var h = plastiq.html;

function render(model) {
  return h('div',
    h('input', {type: 'text', binding: [model, 'text']}),
    zeroClipboard(model.text, h('button', 'copy'))
  );
}

plastiq.append(document.body, render, {});

api

var vdom = zeroClipboard([options], data, buttonVdom);
  • options.oncopy - function that is called after the copy has finished.

  • options.onerror - function that is called when an error occurs, usually if flash isn't available. See the error event in ZeroClipboard documentation.

  • data - either a string, a function that returns a string, or an object containing a string or function for each mime-type, e.g.:

    {
      'text/plain': 'some text',
      'text/html': function () { return '<h1>some html</h1>'; }
    }
    
  • buttonVdom - a vdom element, usually a h('button'), to act as the copy button.

options

zeroClipboard.options({...});

A way to configure ZeroClipboard, just delegates straight to ZeroClipboard.options({...}), see options.

Most often you'll want to do this:

zeroClipboard.options({swfPath: '/path/to/ZeroClipboard.swf'});

Current Tags

  • 1.2.1                                ...           latest (5 years ago)

5 Versions

  • 1.2.1                                ...           5 years ago
  • 1.2.0                                ...           5 years ago
  • 1.1.0                                ...           5 years ago
  • 1.0.1                                ...           5 years ago
  • 1.0.0                                ...           5 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |