From 36171504f9b1f311338625585d4a535583d2b5d6 Mon Sep 17 00:00:00 2001 From: DecentM Date: Wed, 10 May 2017 22:40:33 +0200 Subject: [PATCH 1/3] Add UMD exports --- src/instantclick.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/instantclick.js b/src/instantclick.js index a564c39..001baa1 100644 --- a/src/instantclick.js +++ b/src/instantclick.js @@ -967,3 +967,15 @@ var instantclick } }(document, location, navigator.userAgent); + +(function (root, InstantClick) { + if (typeof define === 'function' && define.amd) { + define([], InstantClick); + } else if (typeof module === 'object' && module.exports) { + module.exports = InstantClick; + } else { + root.returnExports = InstantClick; + } +}(this, function () { + return InstantClick; +})); From 7772ba4beee309c03f892d70883f67b9ec77cc57 Mon Sep 17 00:00:00 2001 From: DecentM Date: Wed, 10 May 2017 23:05:52 +0200 Subject: [PATCH 2/3] Return the InstantClick object itself, not a function that then returns it --- src/instantclick.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/instantclick.js b/src/instantclick.js index 001baa1..3e3824c 100644 --- a/src/instantclick.js +++ b/src/instantclick.js @@ -976,6 +976,4 @@ var instantclick } else { root.returnExports = InstantClick; } -}(this, function () { - return InstantClick; -})); +}(this, InstantClick)); From f3d639553421cc4156640efe09112450a7d23924 Mon Sep 17 00:00:00 2001 From: DecentM Date: Wed, 10 May 2017 23:21:53 +0200 Subject: [PATCH 3/3] Create package.json to make IC npm installable and add node_modules to gitignore --- .gitignore | 1 + package.json | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 package.json diff --git a/.gitignore b/.gitignore index 378eac2..e3fbd98 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ build +node_modules diff --git a/package.json b/package.json new file mode 100644 index 0000000..8ad58e3 --- /dev/null +++ b/package.json @@ -0,0 +1,25 @@ +{ + "name": "instantclick", + "version": "4.0.0", + "description": "InstantClick makes following links in your website instant.", + "main": "src/instantclick.js", + "directories": { + "test": "tests" + }, + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/dieulot/instantclick.git" + }, + "keywords": [ + "pjax" + ], + "author": "dieulot", + "license": "MIT", + "bugs": { + "url": "https://github.com/dieulot/instantclick/issues" + }, + "homepage": "http://instantclick.io/" +}