Skip to content

Commit

Permalink
Updated to version v4.0.5
Browse files Browse the repository at this point in the history
Get direction navigaion on leaveStep and  showStep events
Events added: beginReset, endReset, themeChanged
Examples updated
  • Loading branch information
Dipu Raj committed Nov 16, 2016
1 parent c64cf5b commit 57838d9
Show file tree
Hide file tree
Showing 15 changed files with 125 additions and 36 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,14 @@ Features
+ Ajax content loading with option to specify individual url for steps
+ Keyboard navigation
+ Easy navigation with step anchors and navigation buttons
+ Navigation direction parameter on events
+ Multiple wizard instance on same page
+ Easy to implement, Minimal HTML required
+ and a lot more...

Version
-----
**SmartWizard v4.0.1**
**SmartWizard v4.0.5**

License
----
Expand Down
4 changes: 2 additions & 2 deletions bower.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "smartwizard",
"version": "4.0.1",
"version": "4.0.5",
"homepage": "https://github.com/techlab/SmartWizard",
"authors": [
"Dipu Raj <[email protected]>"
],
"description": "An awesome step wizard jQuery plugin with Bootstrap support",
"description": "An awesome jQuery step wizard plugin with Bootstrap support",
"main": [
"./css/smart_wizard.min.css",
"./js/jquery.smartWizard.min.js"
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "techlab/smartwizard",
"description": "An awesome step wizard jQuery plugin with Bootstrap support",
"version": "4.0.1",
"description": "An awesome jQuery step wizard plugin with Bootstrap support",
"version": "4.0.5",
"homepage": "http://techlaboratory.net/smartwizard",
"license": "MIT",
"support": {
Expand Down
2 changes: 1 addition & 1 deletion css/smart_wizard.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* SmartWizard v4.0.1
/* SmartWizard v4.x
* jQuery Wizard Plugin
* http://www.techlaboratory.net/smartwizard
*
Expand Down
11 changes: 10 additions & 1 deletion css/smart_wizard.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion css/smart_wizard_theme_arrows.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* SmartWizard v4.0.1
/* SmartWizard v4.x
* jQuery Wizard Plugin
* http://www.techlaboratory.net/smartwizard
*
Expand Down
11 changes: 10 additions & 1 deletion css/smart_wizard_theme_arrows.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion css/smart_wizard_theme_circles.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* SmartWizard v4.0.1
/* SmartWizard v4.x
* jQuery Wizard Plugin
* http://www.techlaboratory.net/smartwizard
*
Expand Down
2 changes: 1 addition & 1 deletion css/smart_wizard_theme_dots.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* SmartWizard v4.0.1
/* SmartWizard v4.x
* jQuery Wizard Plugin
* http://www.techlaboratory.net/smartwizard
*
Expand Down
11 changes: 10 additions & 1 deletion css/smart_wizard_theme_dots.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

56 changes: 45 additions & 11 deletions examples/smartwizard-events.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,23 @@
<link href="../css/smart_wizard.min.css" rel="stylesheet" type="text/css" />

<!-- Optional SmartWizard theme -->
<link href="../css/smart_wizard_theme_circles.min.css" rel="stylesheet" type="text/css" />
<link href="../css/smart_wizard_theme_arrows.min.css" rel="stylesheet" type="text/css" />
<link href="../css/smart_wizard_theme_dots.min.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div class="container">

<form class="form-inline">
<div class="form-group">
<label >Choose Theme:</label>
<select id="theme_selector" class="form-control">
<option value="dots">dots</option>
<option value="default">default</option>
<option value="arrows">arrows</option>
</select>
</div>

<label>External Buttons:</label>
<div class="btn-group navbar-btn" role="group">
<button class="btn btn-default" id="prev-btn" type="button">Go Previous</button>
Expand Down Expand Up @@ -81,7 +92,39 @@ <h2>Step 4 Content</h2>

<script type="text/javascript">
$(document).ready(function(){
// Smart Wizard

// Smart Wizard events
$("#smartwizard").on("leaveStep", function(e, anchorObject, stepNumber, stepDirection) {
$("#message-box").append("<br /> > <strong>leaveStep</strong> called on " + stepNumber + ". Direction: " + stepDirection);
var res = confirm("Do you want to leave the step "+stepNumber+"?");
if(!res){
$("#message-box").append(" <strong>leaveStep</strong> Cancelled");
}else{
$("#message-box").append(" <strong>leaveStep</strong> Allowed");
}
return res;
});

// This event should initialize before initializing smartWizard
// Otherwise this event wont load on first page load
$("#smartwizard").on("showStep", function(e, anchorObject, stepNumber, stepDirection) {
$("#message-box").append(" > <strong>showStep</strong> called on " + stepNumber + ". Direction: " + stepDirection);
});

$("#smartwizard").on("beginReset", function(e) {
$("#message-box").append("<br /> > <strong>beginReset</strong> called");
});

$("#smartwizard").on("endReset", function(e) {
$("#message-box").append(" > <strong>endReset</strong> called");
});

$("#smartwizard").on("themeChanged", function(e, theme) {
$("#message-box").append("<br /> > <strong>themeChanged</strong> called. New theme: " + theme);
});


// Smart Wizard initialize
$('#smartwizard').smartWizard({
selected: 0,
theme: 'dots',
Expand All @@ -92,17 +135,8 @@ <h2>Step 4 Content</h2>
{label: 'Cancel', css: 'btn-danger', onClick: function(){ $('#smartwizard').smartWizard("reset"); }}
]
}
});


$("#smartwizard").on("leaveStep", function(e, anchorObject, stepNumber) {
$("#message-box").append(" >leaveStep called on " + stepNumber);
return confirm("Do you want to leave the step "+stepNumber+"?");
});
});

$("#smartwizard").on("showStep", function(e, anchorObject, stepNumber) {
$("#message-box").append(" >showStep called on " + stepNumber);
});

// External Button Events
$("#reset-btn").on("click", function() {
Expand Down
11 changes: 7 additions & 4 deletions examples/smartwizard-input.html
Original file line number Diff line number Diff line change
Expand Up @@ -126,20 +126,23 @@ <h2>Terms and Conditions</h2>
}
});

$("#smartwizard").on("leaveStep", function(e, anchorObject, stepNumber) {
$("#smartwizard").on("leaveStep", function(e, anchorObject, stepNumber, stepDirection) {
var elmForm = $("#form-step-" + stepNumber);
if(elmForm){
// stepDirection === 'forward' :- this condition allows to do the form validation
// only on forward navigation, that makes easy navigation on backwards still do the validation when going next
if(stepDirection === 'forward' && elmForm){
elmForm.validator('validate');
var elmErr = elmForm.children('.has-error');
if(elmErr && elmErr.length > 0){
// Error found
// Form validation failed
return false;
}
}
return true;
});

$("#smartwizard").on("showStep", function(e, anchorObject, stepNumber) {
$("#smartwizard").on("showStep", function(e, anchorObject, stepNumber, stepDirection) {
// Enable finish button only on last step
if(stepNumber == 3){
$('.btn-finish').removeClass('disabled');
}else{
Expand Down
Loading

0 comments on commit 57838d9

Please sign in to comment.