diff --git a/README.md b/README.md index c3f8c8c..4eee878 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,6 @@ -# BlockUI - Page or element overlay +# BlockUI - Page or element overlay [![NPM version][npm-image]][npm-url] + +### NOTE: This is a fork from the official version, for publishing on npm. See https://github.com/malsup/blockui/pull/114 ## Getting Started Download either the [production version][min] or the [development version][max] of BlockUI. @@ -8,21 +10,21 @@ Download either the [production version][min] or the [development version][max] In your web page: -
-<!-- include jQuery --> -<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.js"></script> -<!-- include BlockUI --> -<script src="http://path/to/your/copy/of/jquery.blockUI.js"></script> -<script> -// invoke blockUI as needed --> +```html + + + + + +``` ## Documentation, Demos and FAQ -Everything you need to know can be found here: +Everything you need to know can be found here: [http://jquery.malsup.com/block/](http://jquery.malsup.com/block/) @@ -36,3 +38,6 @@ You may use either license. The MIT license is recommended for most projects be If the GPL suits your project better you are also free to use the plugin under that license. You do not have to do anything special to choose one license or the other and you don't have to notify anyone which license you are using. You are free to use the BlockUI plugin in commercial projects as long as the copyright header is left intact. + +[npm-url]: https://www.npmjs.com/package/block-ui/ +[npm-image]: http://img.shields.io/npm/v/block-ui.svg diff --git a/jquery.blockUI.js b/jquery.blockUI.js index 90ce5d6..13af1c9 100644 --- a/jquery.blockUI.js +++ b/jquery.blockUI.js @@ -611,9 +611,14 @@ /*global define:true */ - if (typeof define === 'function' && define.amd && define.amd.jQuery) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. define(['jquery'], setup); + } else if (typeof exports === 'object') { + // Node/CommonJS + setup(require('jquery')); } else { + // Browser globals setup(jQuery); } diff --git a/package.json b/package.json new file mode 100644 index 0000000..b4728b5 --- /dev/null +++ b/package.json @@ -0,0 +1,39 @@ +{ + "name": "block-ui", + "description": "Simulate synchronous ajax by blocking - not locking - the UI. This plugin lets you block user interaction with the page or with a specific element on the page. Also great at displaying modal dialogs.", + "version": "2.70.0", + "author": "M. Alsup (http://jquery.malsup.com)", + "bugs": { + "url": "https://github.com/malsup/blockui/issues" + }, + "dependencies": { + "jquery": ">=1.7.x" + }, + "homepage": "http://jquery.malsup.com/block/", + "keywords": [ + "block", + "dialog", + "ecosystem:jquery", + "jquery-plugin", + "modal", + "overlay" + ], + "license": [ + { + "type": "MIT", + "url": "http://malsup.github.com/mit-license.txt" + }, + { + "type": "GPL", + "url": "http://malsup.github.com/gpl-license-v2.txt" + } + ], + "main": "jquery.blockUI.js", + "repository": { + "type": "git", + "url": "https://github.com/malsup/blockui.git" + }, + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + } +}