-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
178613f
commit 3705a4e
Showing
11 changed files
with
73 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,8 @@ | |
|
||
[![npm](https://img.shields.io/npm/v/jquery.steps)](https://www.npmjs.com/package/jquery.steps) | ||
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT) | ||
[![npm](https://img.shields.io/npm/dw/jquery.steps)](https://www.npmjs.com/package/jquery.steps) | ||
[![npm](https://img.shields.io/npm/dm/jquery.steps)](https://www.npmjs.com/package/jquery.steps) | ||
[![npm](https://img.shields.io/jsdelivr/npm/hm/jquery.steps)](https://www.npmjs.com/package/jquery.steps) | ||
|
||
> A simple, lightweight jQuery step wizard plugin. | ||
|
@@ -25,8 +26,8 @@ git clone http://github.com/oguzhanoya/jquery-steps.git | |
``` | ||
CDN | ||
```html | ||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected].1/dist/jquery-steps.min.css"> | ||
<script src="https://cdn.jsdelivr.net/npm/[email protected].1/dist/jquery-steps.min.js"></script> | ||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected].2/dist/jquery-steps.min.css"> | ||
<script src="https://cdn.jsdelivr.net/npm/[email protected].2/dist/jquery-steps.min.js"></script> | ||
``` | ||
|
||
## Setup | ||
|
@@ -63,7 +64,7 @@ Make necessary markup for wizard. That's all, you don't need to do anything else | |
``` | ||
Include plugin and dependeces. jQuery is the only dependency, make sure to include it. | ||
```html | ||
<script src="http://code.jquery.com/jquery-latest.min.js"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/jquery/dist/jquery.min.js"></script> | ||
<script src="js/jquery-steps.js"></script> | ||
``` | ||
Init plugin with choosen options. | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -61,8 +61,8 @@ <h3>Tab5</h3> | |
</div> | ||
</div> | ||
|
||
<script src="http://code.jquery.com/jquery-latest.min.js"></script> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-validate/1.16.0/jquery.validate.min.js"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/jquery/dist/jquery.min.js"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/jquery-[email protected]/dist/jquery.validate.min.js"></script> | ||
<script src="../dist/jquery-steps.js"></script> | ||
<script> | ||
var frmInfo = $('#frmInfo'); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,38 +4,37 @@ | |
<meta charset="utf-8"> | ||
<title>Jasmine Spec Runner</title> | ||
<link rel="shortcut icon" type="image/png" href="http://jasmine.github.io/images/jasmine.ico"> | ||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jasmine/2.99.2/jasmine.min.css"> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jasmine/2.99.2/jasmine.min.js"></script> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jasmine/2.99.2/jasmine-html.min.js"></script> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jasmine/2.99.2/boot.min.js"></script> | ||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jasmine/3.7.1/jasmine.min.css"> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jasmine/3.7.1/jasmine.min.js"></script> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jasmine/3.7.1/jasmine-html.min.js"></script> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jasmine/3.7.1/boot.min.js"></script> | ||
</head> | ||
<body> | ||
|
||
<div class="step-app" id="demo" style="display: none;"> | ||
<ul class="step-steps"> | ||
<li data-step-target="step1">Step 1</li> | ||
<li data-step-target="step2">Step 2</li> | ||
<li data-step-target="step3">Step 3</li> | ||
</ul> | ||
<div class="step-content"> | ||
<div class="step-tab-panel" data-step="step1"> | ||
... step1 | ||
<script id="tpl-demo" type="text/html"> | ||
<div class="step-app" id="demo" style="display: none;"> | ||
<ul class="step-steps"> | ||
<% for(var i = 0; i < stepsCount; i++){ %> | ||
<li data-step-target="step{{i}}">Step {{i}}</li> | ||
<% } %> | ||
</ul> | ||
<div class="step-content"> | ||
<% for(var i = 0; i < stepsCount; i++){ %> | ||
<div class="step-tab-panel" data-step="step{{i}}"> | ||
... step{{i}} | ||
</div> | ||
<% } %> | ||
</div> | ||
<div class="step-tab-panel" data-step="step2"> | ||
... step2 | ||
<div class="step-footer"> | ||
<button data-step-action="prev" class="step-btn">Previous</button> | ||
<button data-step-action="next" class="step-btn">Next</button> | ||
<button data-step-action="finish" class="step-btn">Finish</button> | ||
</div> | ||
<div class="step-tab-panel" data-step="step3"> | ||
... step3 | ||
</div> | ||
</div> | ||
<div class="step-footer"> | ||
<button data-step-action="prev" class="step-btn">Previous</button> | ||
<button data-step-action="next" class="step-btn">Next</button> | ||
<button data-step-action="finish" class="step-btn">Finish</button> | ||
</div> | ||
</div> | ||
</script> | ||
|
||
<script src="http://code.jquery.com/jquery-latest.min.js"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/lib/template-web.js"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/jquery.min.js"></script> | ||
<script src="../dist/jquery-steps.js"></script> | ||
<script src="spec.js"></script> | ||
</body> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,38 @@ | ||
describe('My Plugin', function () { | ||
describe('jquery steps', function () { | ||
|
||
var steps_api; | ||
beforeEach(function () { | ||
var data = { | ||
stepsCount: 3, | ||
}; | ||
var html = template('tpl-demo', data); | ||
document.body.insertAdjacentHTML('afterbegin', html); | ||
var steps = $('#demo').steps(); | ||
steps_api = steps.data('plugin_Steps'); | ||
}); | ||
|
||
afterEach(function () { | ||
steps_api.destroy(); | ||
}); | ||
|
||
it('version', function () { | ||
var ver = $.fn.steps.version; | ||
expect(ver).toEqual('1.1.0'); | ||
expect(ver).toEqual('1.1.2'); | ||
}); | ||
|
||
it('next', function () { | ||
steps_api.next(); | ||
steps_api.next(); | ||
var idx = steps_api.getStepIndex(); | ||
expect(idx).toEqual(2); | ||
}); | ||
|
||
it('prev', function () { | ||
steps_api.next(); | ||
steps_api.next(); | ||
steps_api.prev(); | ||
var idx = steps_api.getStepIndex(); | ||
expect(idx).toEqual(1); | ||
}); | ||
|
||
}); |