From f20a8532ffe412d03068ca79c16f7cdfba19f206 Mon Sep 17 00:00:00 2001 From: vsn4ik Date: Sat, 5 Mar 2016 10:42:29 +0300 Subject: [PATCH] Use files for npm and move CONTRIBUTING.md --- .npmignore | 11 ----------- CONTRIBUTING.md | 2 +- README.md | 18 +++++++++--------- package.json | 6 ++++++ src/js/adaptor/jquery.js | 2 -- 5 files changed, 16 insertions(+), 23 deletions(-) delete mode 100644 .npmignore diff --git a/.npmignore b/.npmignore deleted file mode 100644 index d8008ee..0000000 --- a/.npmignore +++ /dev/null @@ -1,11 +0,0 @@ -.DS_Store - -/.eslintrc -/.gitignore -/.travis.yml -/gulpfile.js -/examples -/CONTRIBUTING.md -/.github - -node_modules diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 582c141..d7cabfb 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -28,7 +28,7 @@ Basically, I try to follow [Douglas Crockford's JavaScript Code Conventions](htt You can check if your code fits in the convention with `gulp lint`. ## Getting Started -First, ensure that you have the latest [Node.js](http://nodejs.org/) or [io.js](https://iojs.org) and [npm](http://npmjs.org) installed. +First, ensure that you have stable [Node.js](https://nodejs.org/) and [npm](https://npmjs.com) installed. Test if Gulp CLI is installed by running `gulp --version`. If the command isn't found, run `npm install -g gulp`. For more information about installing Gulp, see the Gulp's [Getting Started](https://github.com/gulpjs/gulp/blob/master/docs/getting-started.md). diff --git a/README.md b/README.md index 1d0f660..72ea2ac 100644 --- a/README.md +++ b/README.md @@ -55,7 +55,7 @@ It's cool, isn't it? #### NPM The best way to install and use perfect-scrollbar is with NPM. -It's registered on [npm](https://www.npmjs.org/package/perfect-scrollbar) as `perfect-scrollbar`. +It's registered on [npm](https://www.npmjs.com/package/perfect-scrollbar) as `perfect-scrollbar`. ``` $ npm install perfect-scrollbar @@ -257,12 +257,12 @@ define([ 'perfectScrollbarJquery' ], function (angular) { - var myApp = angular.module('myApp', []) - .run(function() { + var app = angular.module('myApp', []); + app.run(function () { window.Ps = require('perfectScrollbar'); require('perfectScrollbarJQuery'); - }) - return myApp; + }); + return app; }); ``` @@ -275,7 +275,7 @@ Ps.initialize(container); Ps.update(container); // or by jQuery: -var imgLoader = $("#imgLoader") +var imgLoader = $('#imgLoader') imgLoader.perfectScrollbar(); ``` @@ -345,15 +345,15 @@ Ps.initialize(container, { }); ``` Create a class name prefixed with `.ps-theme-`. Include `ps-container()` mixin. It's recommended to use `map-merge()` to extend `$ps-theme-default` map with your custom styles. -```css# +```scss .ps-theme-my-theme-name { @include ps-container(map-merge($ps-theme-default, ( border-radius: 0, scrollbar-x-rail-height: 20px, scrollbar-x-height: 20px, scrollbar-y-rail-width: 20px, - scrollbar-y-width: 20px,) - )); + scrollbar-y-width: 20px + ))); } ``` diff --git a/package.json b/package.json index cd3c6d2..26f71db 100644 --- a/package.json +++ b/package.json @@ -26,6 +26,12 @@ "engines": { "node": ">= 0.12.0" }, + "files": [ + "dist", + "src", + "index.js", + "jquery.js" + ], "devDependencies": { "browserify": "^11.2.0", "del": "^2.0.2", diff --git a/src/js/adaptor/jquery.js b/src/js/adaptor/jquery.js index f9840fa..ef55e09 100644 --- a/src/js/adaptor/jquery.js +++ b/src/js/adaptor/jquery.js @@ -24,8 +24,6 @@ function mountJQuery(jQuery) { ps.destroy(this); } } - - return jQuery(this); }); }; }