jojequery
Version:
jojequery
109 lines (91 loc) • 2.59 kB
JavaScript
(function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory();
else if(typeof define === 'function' && define.amd)
define("$", [], factory);
else if(typeof exports === 'object')
exports["$"] = factory();
else
root["$"] = factory();
})(this, function() {
return /******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId])
/******/ return installedModules[moduleId].exports;
/******/
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ exports: {},
/******/ id: moduleId,
/******/ loaded: false
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.loaded = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(0);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ function(module, exports) {
function Selector(selector) {
var els = document.querySelectorAll(selector);
var self = this;
[].forEach.call(els, function(el) {
self.push(el);
});
}
function Plugins() {}
Plugins.prototype = new Array();
var fn = new Plugins();
Selector.prototype = fn;
fn.each = function(fn) {
this.forEach(function(el) {
fn.call(el);
});
return this;
};
function $(selector) {
if( selector instanceof Document ) {
return {
ready: function(fn) {
document.addEventListener('DOMContentLoaded', function() {
fn($);
});
}
};
}
return new Selector(selector);
}
$.fn = fn;
module.exports = $;
/***/ }
/******/ ])
});
;
//# sourceMappingURL=jojequery.js.map