Skip to content

Commit

Permalink
Merge pull request #16 from mauriciosoares/feature/umd-support
Browse files Browse the repository at this point in the history
Adds UMD support
  • Loading branch information
zenorocha committed Sep 29, 2015
2 parents a4a68d8 + 05a807e commit ffb2b3f
Show file tree
Hide file tree
Showing 4 changed files with 83 additions and 88 deletions.
165 changes: 81 additions & 84 deletions dist/clipboard.js
Original file line number Diff line number Diff line change
@@ -1,52 +1,4 @@
(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
var matches = require('matches-selector')

module.exports = function (element, selector, checkYoSelf) {
var parent = checkYoSelf ? element : element.parentNode

while (parent && parent !== document) {
if (matches(parent, selector)) return parent;
parent = parent.parentNode
}
}

},{"matches-selector":4}],2:[function(require,module,exports){
var bind = window.addEventListener ? 'addEventListener' : 'attachEvent',
unbind = window.removeEventListener ? 'removeEventListener' : 'detachEvent',
prefix = bind !== 'addEventListener' ? 'on' : '';

/**
* Bind `el` event `type` to `fn`.
*
* @param {Element} el
* @param {String} type
* @param {Function} fn
* @param {Boolean} capture
* @return {Function}
* @api public
*/

exports.bind = function(el, type, fn, capture){
el[bind](prefix + type, fn, capture || false);
return fn;
};

/**
* Unbind `el` event `type`'s callback `fn`.
*
* @param {Element} el
* @param {String} type
* @param {Function} fn
* @param {Boolean} capture
* @return {Function}
* @api public
*/

exports.unbind = function(el, type, fn, capture){
el[unbind](prefix + type, fn, capture || false);
return fn;
};
},{}],3:[function(require,module,exports){
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.Clipboard = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
/**
* Module dependencies.
*/
Expand Down Expand Up @@ -98,47 +50,95 @@ exports.unbind = function(el, type, fn, capture){
event.unbind(el, type, fn, capture);
};

},{"closest":1,"component-event":2}],4:[function(require,module,exports){

/**
* Element prototype.
*/

var proto = Element.prototype;

/**
* Vendor function.
*/

var vendor = proto.matchesSelector
|| proto.webkitMatchesSelector
|| proto.mozMatchesSelector
|| proto.msMatchesSelector
|| proto.oMatchesSelector;
},{"closest":2,"component-event":4}],2:[function(require,module,exports){
var matches = require('matches-selector')

module.exports = function (element, selector, checkYoSelf) {
var parent = checkYoSelf ? element : element.parentNode

while (parent && parent !== document) {
if (matches(parent, selector)) return parent;
parent = parent.parentNode
}
}

},{"matches-selector":3}],3:[function(require,module,exports){

/**
* Element prototype.
*/

var proto = Element.prototype;

/**
* Vendor function.
*/

var vendor = proto.matchesSelector
|| proto.webkitMatchesSelector
|| proto.mozMatchesSelector
|| proto.msMatchesSelector
|| proto.oMatchesSelector;

/**
* Expose `match()`.
*/

module.exports = match;

/**
* Match `el` to `selector`.
*
* @param {Element} el
* @param {String} selector
* @return {Boolean}
* @api public
*/

function match(el, selector) {
if (vendor) return vendor.call(el, selector);
var nodes = el.parentNode.querySelectorAll(selector);
for (var i = 0; i < nodes.length; ++i) {
if (nodes[i] == el) return true;
}
return false;
}
},{}],4:[function(require,module,exports){
var bind = window.addEventListener ? 'addEventListener' : 'attachEvent',
unbind = window.removeEventListener ? 'removeEventListener' : 'detachEvent',
prefix = bind !== 'addEventListener' ? 'on' : '';

/**
* Expose `match()`.
* Bind `el` event `type` to `fn`.
*
* @param {Element} el
* @param {String} type
* @param {Function} fn
* @param {Boolean} capture
* @return {Function}
* @api public
*/

module.exports = match;
exports.bind = function(el, type, fn, capture){
el[bind](prefix + type, fn, capture || false);
return fn;
};

/**
* Match `el` to `selector`.
* Unbind `el` event `type`'s callback `fn`.
*
* @param {Element} el
* @param {String} selector
* @return {Boolean}
* @param {String} type
* @param {Function} fn
* @param {Boolean} capture
* @return {Function}
* @api public
*/

function match(el, selector) {
if (vendor) return vendor.call(el, selector);
var nodes = el.parentNode.querySelectorAll(selector);
for (var i = 0; i < nodes.length; ++i) {
if (nodes[i] == el) return true;
}
return false;
}
exports.unbind = function(el, type, fn, capture){
el[unbind](prefix + type, fn, capture || false);
return fn;
};
},{}],5:[function(require,module,exports){
function E () {
// Keep this empty so it's easier to inherit from
Expand Down Expand Up @@ -415,7 +415,6 @@ exports['default'] = ClipboardAction;
module.exports = exports['default'];

},{}],7:[function(require,module,exports){
(function (global){
'use strict';

exports.__esModule = true;
Expand Down Expand Up @@ -536,9 +535,7 @@ var Clipboard = (function (_Emitter) {
})(_tinyEmitter2['default']);

exports['default'] = Clipboard;

global.Clipboard = Clipboard;
module.exports = exports['default'];

}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
},{"./clipboard-action":6,"delegate-events":3,"tiny-emitter":5}]},{},[7]);
},{"./clipboard-action":6,"delegate-events":1,"tiny-emitter":5}]},{},[7])(7)
});
2 changes: 1 addition & 1 deletion dist/clipboard.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit ffb2b3f

Please sign in to comment.