Skip to content

Commit 9e43f07

Browse files
committed
Cleaned up, fixes, documenation
1 parent b97a11e commit 9e43f07

24 files changed

+372
-421
lines changed

.gitignore

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
/mpp-sw.txt
2-
/examples/smartwizard-bs.html
3-
/examples/Wizard Button.html
41
/node_modules/
52
/bower_components/
63
/vendor/
4+
/public/
75

86
# IDE Files
97
#-------------------------
@@ -18,4 +16,3 @@
1816
*.sublime-workspace
1917
*.sublime-project
2018
/nbproject/private/
21-
/refer.txt

CONTRIBUTING.md

Lines changed: 26 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,41 @@
11
# Contributing
22

3-
## What can I contribute?
4-
- Fix a bug you found or already reported on the GitHub Issues Tracker.
3+
## How can I contribute?
4+
- Fix a bug you found or already reported.
55
- Add new features to the project.
6+
- Create new themes
67
- Add new test cases.
78
- Add documentation.
89
- Add a demo page.
9-
- [Donate](https://www.paypal.me/dipuraj) money for the project on [![Paypal](https://img.shields.io/badge/PayPal-dipuraj-blue.svg)](https://www.paypal.me/dipuraj).
1010

1111
## How to contribute code?
1212
Here are the basic steps to get started contributing code:
1313

14-
1. Fork the repository and get development running on your computer.
15-
2. Install the npm development dependencies by the command `npm install` on the project folder (Assumes you already have NodeJS installed).
16-
3. Replicate the issue you're trying to fix or spec out the feature you're trying to add.
17-
4. Change the code to fix the bug or add the feature. All changes should happen in the relevant `src/js/*.js` and `src/css/*.css` files.
18-
5. Build the code by running `npm run build` or `gulp`.
19-
6. Run the test cases by running `npm test` or `gulp test`, you can also add more test cases based on your new change.
20-
7. Verify that your fix or feature works.
21-
8. Commit your changes with an informative description.
22-
9. Open a pull request to the repository with your new commit and a descriptive message about what the PR does.
14+
1. Fork the repository.
15+
2. Install the dependencies, run `npm install`.
16+
3. Start the project, run `npm start`.
17+
4. Replicate the issue you're trying to fix or spec out the feature you're trying to add.
18+
5. Modify the code to fix the bug or to add the feature. All changes should happen in the relevant `src/` files.
19+
6. Verify that your fix or feature works.
20+
7. Run the test cases by running `npm test`, you can also add more test cases based on your new change.
21+
8. Build the code by running `npm run build`.
22+
9. Commit your changes with an informative description.
23+
10. Open a pull request with a descriptive message about what the PR does.
24+
25+
Thank you for your contribution!
26+
27+
##### Notes for pull request
28+
- Follow the same code style as the library.
29+
- Run the test suites in the `test` directory first by running `npm test`.
30+
- Don't modify any files in the `dist` directory.
31+
- Don't alter the licence headers.
2332

2433
## Reporting bugs
25-
### Make sure it is a bug related to this project
34+
#### Make sure it is a bug related to this project
2635
Before reporting the bug, please make sure that the bug is in the project and not from your own code or any other library used.
2736

28-
### Try the latest version
29-
Bugs in the older versions of the project may have already been fixed.
30-
In order to avoid reporting known issues, make sure you are always testing against the latest release.
31-
Also make sure the problem hasn't already been reported on the GitHub Issues Tracker.
37+
#### Try the latest version
38+
Bugs in the older versions of the project may have already been fixed.
39+
In order to avoid reporting known issues, make sure you are always testing against the latest release.
40+
Also make sure the problem hasn't already been reported on the GitHub Issues Tracker.
3241
If not, create a new issue there and include your test case.
33-
34-
### Notes for pull request
35-
- Follow the same code style as the library.
36-
- Run the test suites in the `test` directory first by running `npm test` or `gulp test`.
37-
- Don't modify any files in the `dist` directory.
38-
- Don't alter the licence headers.

LICENSE

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1 @@
1-
MIT License
2-
3-
Copyright (c) 2017 Dipu Raj
4-
http://dipuraj.me
5-
6-
Permission is hereby granted, free of charge, to any person obtaining a copy
7-
of this software and associated documentation files (the "Software"), to deal
8-
in the Software without restriction, including without limitation the rights
9-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10-
copies of the Software, and to permit persons to whom the Software is
11-
furnished to do so, subject to the following conditions:
12-
13-
The above copyright notice and this permission notice shall be included in all
14-
copies or substantial portions of the Software.
15-
16-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22-
SOFTWARE.
1+
LICENSE

README.md

Lines changed: 28 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
# jQuery Gulp Plugin Example
2-
#### The example repository for the article [jQuery plugin development with Gulp automation](https://medium.com/@dipuraj/jquery-plugin-development-with-gulp-automation-ae5d2c180f85)
1+
# jQuery Plugin Boilerplate
2+
#### jQuery plugin development boilerplate with gulp automation
33

4-
[![Build Status](https://travis-ci.org/techlab/jquery-gulp-example.svg?branch=master)](https://travis-ci.org/techlab/jquery-gulp-example)
5-
[![npm version](https://badge.fury.io/js/jquery-gulp-example.svg)](https://badge.fury.io/js/jquery-gulp-example)
6-
[![Bower version](https://badge.fury.io/bo/jquery-gulp-example.svg)](https://badge.fury.io/bo/jquery-gulp-example)
7-
[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/techlab/jquery-gulp-example/master/LICENSE)
4+
[![Build Status](https://travis-ci.org/techlab/jquery-plugin-boilerplate.svg?branch=master)](https://travis-ci.org/techlab/jquery-plugin-boilerplate)
5+
[![npm version](https://badge.fury.io/js/jquery-plugin-boilerplate.svg)](https://badge.fury.io/js/jquery-plugin-boilerplate)
6+
[![Bower version](https://badge.fury.io/bo/jquery-plugin-boilerplate.svg)](https://badge.fury.io/bo/jquery-plugin-boilerplate)
7+
[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/techlab/jquery-plugin-boilerplate/master/LICENSE)
88
[![Donate on Paypal](https://img.shields.io/badge/PayPal-dipuraj-blue.svg)](https://www.paypal.me/dipuraj)
99

1010
Articles
@@ -15,27 +15,39 @@ Requirements
1515
-----
1616
+ [jQuery](http://jquery.com/) (supports jQuery 1.9+, jQuery 2+ and jQuery 3+)
1717

18-
Installation and usage
18+
Installation and usage
1919
-----
2020

21-
### [NPM](https://www.npmjs.com/package/jquery-gulp-example)
22-
npm install jquery-gulp-example
23-
24-
### Bower
25-
bower install jquery-gulp-example
26-
21+
### NPM
22+
npm install jquery-plugin-boilerplate
23+
24+
### Yarn
25+
yarn add jquery-plugin-boilerplate
26+
2727
### Download
28-
#### [Download from GitHub](https://github.com/techlab/jquery-gulp-example/archive/master.zip)
28+
#### [Download from GitHub](https://github.com/techlab/jquery-plugin-boilerplate/archive/master.zip)
2929

30+
How to use
31+
----
32+
- Clone or download this repository.
33+
- Run `npm start` on the directory.
34+
- It will open the project on browser with hot loading enbaled with [Browserify](http://browserify.org/).
35+
- Start wrting your code on `src` directory.
36+
37+
More details
38+
----
39+
- Build files will be generated on `dist` directory automatically.
40+
- You can change `example` directory for examples of your plugin.
41+
- `test` directory contains test scripts. It uses [Jasmine](https://jasmine.github.io/) and [Karma](https://karma-runner.github.io/).
3042

3143
License
3244
----
33-
[MIT License](https://github.com/techlab/jquery-gulp-example/blob/master/LICENSE)
45+
[MIT License](https://github.com/techlab/jquery-plugin-boilerplate/blob/master/LICENSE)
3446

3547
Contribute
3648
----
3749
If you like the project please support with your contribution.
3850

3951
[Donate on Paypal](https://www.paypal.me/dipuraj)
4052

41-
Thank you :)
53+
Thank you and Happy Coding :)

bower.json

Lines changed: 0 additions & 37 deletions
This file was deleted.

dist/css/alter_me.css

Lines changed: 0 additions & 32 deletions
This file was deleted.

dist/css/alter_me.min.css

Lines changed: 0 additions & 11 deletions
This file was deleted.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/*!
2+
* jQuery Plugin Boilerplate v1.0,0
3+
*
4+
* Created by <Author>
5+
*
6+
* @license
7+
*/
8+
.my-style1 {
9+
background-color: green;
10+
color: #fff;
11+
padding: 10px;
12+
}
13+
14+
.my-style2 {
15+
background-color: red;
16+
color: #000;
17+
padding: 10px;
18+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/*!
2+
* jQuery Plugin Boilerplate v1.0,0
3+
*
4+
* Created by <Author>
5+
*
6+
* @license
7+
*/.my-style1{background-color:green;color:#fff;padding:10px}.my-style2{background-color:red;color:#000;padding:10px}
Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
"use strict";
2+
3+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
4+
5+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
6+
7+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
8+
9+
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
10+
11+
/*!
12+
* TODO: PLUGIN DETAILS - CHANGE TO YOUR OWN
13+
* jQuery Plugin Boilerplate v1.0,0
14+
*
15+
* Created by <Author>
16+
*
17+
* @license
18+
*/
19+
// SEARCH FOR "TODO:" TO MAKE THE CHANGES
20+
(function (factory) {
21+
if (typeof define === 'function' && define.amd) {
22+
// AMD. Register as an anonymous module.
23+
define(['jquery'], factory);
24+
} else if ((typeof module === "undefined" ? "undefined" : _typeof(module)) === 'object' && module.exports) {
25+
// Node/CommonJS
26+
module.exports = function (root, jQuery) {
27+
if (jQuery === undefined) {
28+
// require('jQuery') returns a factory that requires window to
29+
// build a jQuery instance, we normalize how we use modules
30+
// that require this pattern but the window provided is a noop
31+
// if it's defined (how jquery works)
32+
if (typeof window !== 'undefined') {
33+
jQuery = require('jquery');
34+
} else {
35+
jQuery = require('jquery')(root);
36+
}
37+
}
38+
39+
factory(jQuery);
40+
return jQuery;
41+
};
42+
} else {
43+
// Browser globals
44+
factory(jQuery);
45+
}
46+
})(function ($) {
47+
"use strict"; // Default Options
48+
49+
var defaults = {
50+
// TODO: ADD YOUR DEFAULT OPTIONS HERE
51+
myStyle: 'my-style1'
52+
}; // TODO: PLUGIN CLASS NAME - CHANGE TO YOUR OWN. Use CapitolCase
53+
54+
var PluginBoilerplate = /*#__PURE__*/function () {
55+
function PluginBoilerplate(element, options) {
56+
_classCallCheck(this, PluginBoilerplate);
57+
58+
// Merge user settings with default
59+
this.options = $.extend(true, {}, defaults, options); // Main container element
60+
61+
this.main = $(element); // Initial load
62+
63+
this._init();
64+
} // Initial Method
65+
66+
67+
_createClass(PluginBoilerplate, [{
68+
key: "_init",
69+
value: function _init() {
70+
// Plugin init and logic
71+
this.main.addClass(this.options.myStyle);
72+
} // TODO: YOU CAN ADD MORE FUNCTIONS FOR YOUR PLUGIN HERE
73+
74+
}]);
75+
76+
return PluginBoilerplate;
77+
}(); // Wrapper for the plugin
78+
// TODO: PLUGIN NAME - CHANGE TO YOUR OWN. Use camelCase
79+
80+
81+
$.fn.pluginBoilerplate = function (options) {
82+
// TODO: PLUGIN NAME - CHANGE TO YOUR OWN
83+
var pluginName = "pluginBoilerplate";
84+
85+
if (options === undefined || _typeof(options) === 'object') {
86+
return this.each(function () {
87+
if (!$.data(this, pluginName)) {
88+
// TODO: PLUGIN CLASS NAME - CHANGE TO YOUR OWN. Use CapitolCase
89+
$.data(this, pluginName, new PluginBoilerplate(this, options));
90+
}
91+
});
92+
} else if (typeof options === 'string' && options[0] !== '_' && options !== 'init') {
93+
var instance = $.data(this[0], pluginName);
94+
95+
if (options === 'destroy') {
96+
$.data(this, pluginName, null);
97+
} // TODO: PLUGIN CLASS NAME - CHANGE TO YOUR OWN. Use CapitolCase
98+
99+
100+
if (instance instanceof PluginBoilerplate && typeof instance[options] === 'function') {
101+
return instance[options].apply(instance, Array.prototype.slice.call(arguments, 1));
102+
} else {
103+
return this;
104+
}
105+
}
106+
};
107+
});

0 commit comments

Comments
 (0)