├── .gitattributes ├── .gitignore ├── .travis.yml ├── CHANGELOG.md ├── Gruntfile.js ├── LICENSE.txt ├── README.md ├── bower.json ├── build ├── jQuery.Steps.1.1.0.nupkg ├── jquery.steps-1.1.0.zip ├── jquery.steps.js └── jquery.steps.min.js ├── demo ├── css │ ├── jquery.steps.css │ ├── main.css │ └── normalize.css ├── index.html ├── tabs.html └── vertical.html ├── lib ├── jquery-1.10.2.min.js ├── jquery-1.11.1.min.js ├── jquery-1.9.1.min.js ├── jquery.cookie-1.3.1.js └── modernizr-2.6.2.min.js ├── nuget ├── NuGet.exe └── jQuery.Steps.nuspec ├── package.json ├── src ├── _banner.js ├── defaults.js ├── enums.js ├── helper.js ├── model.js ├── privates.js └── publics.js ├── steps.jquery.json └── test ├── index.html ├── jquery.js ├── qunit ├── qunit-1.11.0.css └── qunit-1.11.0.js └── tests.js /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | dist 2 | jSteps 3 | docs 4 | downloads 5 | *~ 6 | *.diff 7 | *.patch 8 | .DS_Store 9 | node_modules -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - 0.10 4 | install: 5 | - npm install grunt-cli -g 6 | - npm install -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | ## 1.1.0 4 | - Added event `onInit` which is fired when the component is completely initialized. Closes issue [#80](https://github.com/rstaib/jquery-steps/issues/80) 5 | - Added event `onContentLoaded` which is fired when the step content is loaded (only in async cases relevant) Closes issue [#88](https://github.com/rstaib/jquery-steps/issues/88) and [#97](https://github.com/rstaib/jquery-steps/issues/97) 6 | 7 | ## 1.0.8 8 | - Fixed issue [#91](https://github.com/rstaib/jquery-steps/issues/91) (`stepChanged` event is fired before transitions are done) 9 | 10 | ## 1.0.7 11 | - Small fix. Closes issue [#58](https://github.com/rstaib/jquery-steps/issues/58) 12 | - Set the default value of `enableCancelButton` for backward compatibility reasons to `false` 13 | 14 | ## 1.0.6 15 | - Small fix. Closes issue [#56](https://github.com/rstaib/jquery-steps/issues/56) 16 | 17 | ## 1.0.5 18 | 19 | - Added a cancel button 20 | - Fixed a bug regarding adding steps dynamically. Closes issue [#56](https://github.com/rstaib/jquery-steps/issues/56) 21 | 22 | ## 1.0.4 23 | 24 | - Fixed an issue regarding currentIndex on finish and finished event. Closes issue [#24](https://github.com/rstaib/jquery-steps/issues/24) and [#33](https://github.com/rstaib/jquery-steps/issues/33) 25 | 26 | ## 1.0.3 27 | 28 | - Adding an id to the outer control wrapper tag will have as of now an impact on the internal uniqueid handling and therefore to the sub tag ids as well 29 | 30 | ## 1.0.2 31 | 32 | - Add destroy method to remove the control functionality completely 33 | 34 | ## 1.0.1 35 | 36 | - Fixed an iframe border and scrolling issue for older browsers (IE8 and lower) 37 | 38 | ## 1.0.0 39 | 40 | - Nested tags which have the same node name as the body tag cause an exception. Closes issue [#4](https://github.com/rstaib/jquery-steps/issues/4) 41 | - Separated data and UI changes from each other and improved code for testability 42 | - Optimized code for better minification 43 | - Configurable clearfix css class 44 | - Vertical step navigation (default: horizontal) 45 | - Removed `"use strict";` because of an ASP.Net tracing issue related to FF (see jQuery ticket: #13335) 46 | 47 | ## 0.9.7 48 | 49 | - On finish failed the last step button does not become highlighted as error. Closes issue [#3](https://github.com/rstaib/jquery-steps/issues/3) 50 | - Advanced accessibility support (WAI-ARIA) 51 | - Replace Number() by parseInt() for parsing `string` to `int` values 52 | - Add `"use strict";` and some other recommended things like the leading `;` 53 | - Substitute `ol` by `ul` tag for step navigation 54 | - Improve performance due to code refactoring 55 | 56 | ## 0.9.6 57 | 58 | - Make css class for the outer component wrapper editable 59 | - Add saveState option flag to enable/disable state persistence (saves last active step position) 60 | - Add current class to step title and body for convinient css targeting [#2](https://github.com/rstaib/jquery-steps/issues/2) 61 | - Add a bugfix related to the `startIndex` property 62 | - Add a bugfix related to focusing after step changes 63 | -------------------------------------------------------------------------------- /Gruntfile.js: -------------------------------------------------------------------------------- 1 | /*jshint node:true*/ 2 | module.exports = function (grunt) 3 | { 4 | "use strict"; 5 | 6 | /* Hint: Using grunt-strip-code to remove comments from the release file */ 7 | 8 | grunt.initConfig({ 9 | pkg: grunt.file.readJSON('package.json'), 10 | concat: { 11 | options: { 12 | separator: '\r\n\r\n', 13 | banner: '/*! <%= "\\r\\n * " + pkg.title %> v<%= pkg.version %> - <%= grunt.template.today("mm/dd/yyyy") + "\\r\\n" %>' + 14 | ' * Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %> <%= (pkg.homepage ? "(" + pkg.homepage + ")" : "") + "\\r\\n" %>' + 15 | ' * Licensed under <%= pkg.licenses[0].type + " " + pkg.licenses[0].url + "\\r\\n */\\r\\n" %>' + 16 | ';(function ($, undefined)\r\n{\r\n', 17 | footer: '\r\n})(jQuery);' 18 | }, 19 | dist: { 20 | files: { 21 | '<%= pkg.folders.dist %>/jquery.steps.js': [ 22 | '<%= pkg.folders.src %>/helper.js', 23 | '<%= pkg.folders.src %>/privates.js', 24 | '<%= pkg.folders.src %>/publics.js', 25 | '<%= pkg.folders.src %>/enums.js', 26 | '<%= pkg.folders.src %>/model.js', 27 | '<%= pkg.folders.src %>/defaults.js' 28 | ] 29 | } 30 | } 31 | }, 32 | //"regex-replace": { 33 | // all: { 34 | // src: ['<%= pkg.folders.nuget %>/jQuery.Steps.nuspec'], 35 | // actions: [ 36 | // { 37 | // name: 'versionNumber', 38 | // search: /.*?<\/version>/gi, 39 | // replace: '<%= pkg.version %>' 40 | // } 41 | // ] 42 | // } 43 | //}, 44 | exec: { 45 | createPkg: { 46 | cmd: "<%= pkg.folders.nuget %>\\Nuget pack <%= pkg.folders.nuget %>\\jQuery.Steps.nuspec -OutputDirectory <%= pkg.folders.dist %> -Version <%= pkg.version %>" 47 | } 48 | }, 49 | compress: { 50 | main: { 51 | options: { 52 | archive: '<%= pkg.folders.dist %>/jquery.steps-<%= pkg.version %>.zip' 53 | }, 54 | files: [ 55 | { flatten: true, expand: true, src: ['<%= pkg.folders.dist %>/*.js'], dest: '/' } 56 | ] 57 | } 58 | }, 59 | uglify: { 60 | options: { 61 | preserveComments: 'some', 62 | report: 'gzip' 63 | }, 64 | all: { 65 | files: { 66 | '<%= pkg.folders.dist %>/jquery.steps.min.js': ['<%= pkg.folders.dist %>/jquery.steps.js'] 67 | } 68 | } 69 | }, 70 | qunit: { 71 | files: ['test/index.html'] 72 | }, 73 | jshint: { 74 | options: { 75 | curly: true, 76 | eqeqeq: true, 77 | immed: true, 78 | latedef: true, 79 | newcap: true, 80 | noarg: true, 81 | sub: true, 82 | undef: true, 83 | eqnull: true, 84 | browser: true, 85 | globals: { 86 | jQuery: true, 87 | $: true, 88 | console: true 89 | } 90 | }, 91 | files: ['<%= pkg.folders.dist %>/jquery.steps.js'], 92 | test: { 93 | options: { 94 | globals: { 95 | jQuery: true, 96 | $: true, 97 | QUnit: true, 98 | module: true, 99 | test: true, 100 | start: true, 101 | stop: true, 102 | expect: true, 103 | ok: true, 104 | equal: true, 105 | deepEqual: true, 106 | strictEqual: true 107 | } 108 | }, 109 | files: { 110 | src: [ 111 | 'test/tests.js' 112 | ] 113 | } 114 | }, 115 | grunt: { 116 | files: { 117 | src: [ 118 | 'Gruntfile.js' 119 | ] 120 | } 121 | } 122 | }, 123 | yuidoc: { 124 | compile: { 125 | name: '<%= pkg.name %>', 126 | description: '<%= pkg.description %>', 127 | version: '<%= pkg.version %>', 128 | url: '<%= pkg.homepage %>', 129 | options: { 130 | exclude: 'qunit-1.11.0.js', 131 | paths: '.', 132 | outdir: '<%= pkg.folders.docs %>/' 133 | } 134 | } 135 | }, 136 | clean: { 137 | api: ["<%= pkg.folders.docs %>"], 138 | build: ["<%= pkg.folders.dist %>"] 139 | } 140 | }); 141 | 142 | grunt.loadNpmTasks('grunt-contrib-jshint'); 143 | grunt.loadNpmTasks('grunt-contrib-qunit'); 144 | grunt.loadNpmTasks('grunt-contrib-uglify'); 145 | grunt.loadNpmTasks('grunt-contrib-concat'); 146 | grunt.loadNpmTasks('grunt-contrib-yuidoc'); 147 | grunt.loadNpmTasks('grunt-contrib-clean'); 148 | grunt.loadNpmTasks('grunt-contrib-compress'); 149 | grunt.loadNpmTasks('grunt-regex-replace'); 150 | grunt.loadNpmTasks('grunt-exec'); 151 | 152 | grunt.registerTask('default', ['build']); 153 | grunt.registerTask('api', ['clean:api', 'yuidoc']); 154 | grunt.registerTask('build', ['clean:build', 'concat', 'jshint', 'qunit']); 155 | grunt.registerTask('release', ['build', 'api', 'uglify', 'compress', 'exec:createPkg']); 156 | }; -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2013 Rafael J. Staib 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | jQuery Steps Plugin [![Build Status](https://travis-ci.org/rstaib/jquery-steps.svg?branch=master)](https://travis-ci.org/rstaib/jquery-steps) [![Bower version](https://badge.fury.io/bo/jquery.steps.svg)](http://badge.fury.io/bo/jquery.steps) [![NuGet version](https://badge.fury.io/nu/jquery.steps.svg)](http://badge.fury.io/nu/jquery.steps) 2 | ============ 3 | 4 | A powerful jQuery wizard plugin that supports accessibility and HTML5. 5 | 6 | ## Getting Started 7 | 8 | **jQuery Steps** is a lightweight wizard UI component written for **jQuery**. 9 | 10 | Everything you need to start is: 11 | 12 | 1. Include **jQuery** and **jQuery Steps** in your HTML code. 13 | 2. Then select an element represents the wizard and call the `steps` method. 14 | 15 | ```html 16 | 17 | 18 | 19 | Demo 20 | 21 | 22 | 23 | 24 | 25 | 26 | 29 |
30 | 31 | 32 | ``` 33 | 34 | > For more information [check the documentation](https://github.com/rstaib/jquery-steps/wiki). 35 | 36 | ### How to add initial steps? 37 | 38 | There are two ways to add steps and their corresponding content. 39 | 40 | 1. Add HTML code into the representing wizard element. 41 | 42 | ```html 43 |
44 |

First Step

45 |
First Content
46 | 47 |

Second Step

48 |
Second Content
49 |
50 | ``` 51 | 52 | 2. Or use the API to add steps dynamically. 53 | 54 | ```javascript 55 | // Initialize wizard 56 | var wizard = $("#wizard").steps(); 57 | 58 | // Add step 59 | wizard.steps("add", { 60 | title: "HTML code", 61 | content: "HTML code" 62 | }); 63 | ``` 64 | 65 | > For more samples [check the demos](https://github.com/rstaib/jquery-steps/wiki#demo). 66 | 67 | ## Reporting an Issue 68 | 69 | Instructions will follow soon! 70 | 71 | ## Asking questions 72 | 73 | I'm always happy to help answer your questions. The best way to get quick answers is to go to [stackoverflow.com](http://stackoverflow.com) and tag your questions always with **jquery-steps**. 74 | 75 | ## Contributing 76 | 77 | Instructions will follow soon! 78 | 79 | ## License 80 | 81 | Copyright (c) 2013 Rafael J. Staib Licensed under the [MIT license](https://github.com/rstaib/jquery-steps/blob/master/LICENSE.txt). 82 | -------------------------------------------------------------------------------- /bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jquery.steps", 3 | "description": "A powerful jQuery wizard plugin that supports accessibility and HTML5.", 4 | "keywords": [ 5 | "wizard", 6 | "navigation", 7 | "forms", 8 | "UI", 9 | "component", 10 | "HTML5", 11 | "accessibility", 12 | "validation", 13 | "tabs", 14 | "steps" 15 | ], 16 | "version": "1.1.0", 17 | "authors": [ 18 | { "name": "Rafael Staib", "email": "me@rafaelstaib.com", "url": "http://www.rafaelstaib.com" } 19 | ], 20 | "homepage": "http://www.jquery-steps.com", 21 | "repository": { 22 | "type": "git", 23 | "url": "git://github.com/rstaib/jquery-steps.git" 24 | }, 25 | "license": "MIT", 26 | "main": [ 27 | "build/jquery.steps.js", 28 | "demo/css/jquery.steps.css" 29 | ], 30 | "ignore": [ 31 | "**/.*", 32 | "build/*.nupkg", 33 | "build/*.zip", 34 | "lib", 35 | "nuget", 36 | "src", 37 | "test", 38 | "*.md", 39 | "*.txt", 40 | "Gruntfile.js", 41 | "package.json", 42 | "steps.jquery.json" 43 | ], 44 | "dependencies": { 45 | "jquery": ">=1.9.0" 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /build/jQuery.Steps.1.1.0.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rstaib/jquery-steps/4e1078beec5a7c40abbb3c27e6aefc8203cc2ffc/build/jQuery.Steps.1.1.0.nupkg -------------------------------------------------------------------------------- /build/jquery.steps-1.1.0.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rstaib/jquery-steps/4e1078beec5a7c40abbb3c27e6aefc8203cc2ffc/build/jquery.steps-1.1.0.zip -------------------------------------------------------------------------------- /build/jquery.steps.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * jQuery Steps v1.1.0 - 09/04/2014 3 | * Copyright (c) 2014 Rafael Staib (http://www.jquery-steps.com) 4 | * Licensed under MIT http://www.opensource.org/licenses/MIT 5 | */ 6 | !function(a,b){function c(a,b){o(a).push(b)}function d(d,e,f){var g=d.children(e.headerTag),h=d.children(e.bodyTag);g.length>h.length?R(Z,"contents"):g.length *");e.removeData("loaded").removeData("mode").removeData("url"),e.removeAttr("id").removeAttr("role").removeAttr("tabindex").removeAttr("class").removeAttr("style")._removeAria("labelledby")._removeAria("hidden"),b.find(".content > [data-mode='async'],.content > [data-mode='iframe']").empty();var f=a('<{0} class="{1}">'.format(b.get(0).tagName,b.attr("class"))),g=b._id();return null!=g&&""!==g&&f._id(g),f.html(b.find(".content").html()),b.after(f),b.remove(),f}function h(a,b){var c=a.find(".steps li").eq(b.currentIndex);a.triggerHandler("finishing",[b.currentIndex])?(c.addClass("done").removeClass("error"),a.triggerHandler("finished",[b.currentIndex])):c.addClass("error")}function i(a){var b=a.data("eventNamespace");return null==b&&(b="."+q(a),a.data("eventNamespace",b)),b}function j(a,b){var c=q(a);return a.find("#"+c+V+b)}function k(a,b){var c=q(a);return a.find("#"+c+W+b)}function l(a,b){var c=q(a);return a.find("#"+c+X+b)}function m(a){return a.data("options")}function n(a){return a.data("state")}function o(a){return a.data("steps")}function p(a,b){var c=o(a);return(0>b||b>=c.length)&&R(Y),c[b]}function q(a){var b=a.data("uid");return null==b&&(b=a._id(),null==b&&(b="steps-uid-".concat(T),a._id(b)),T++,a.data("uid",b)),b}function r(a,c){if(S("enumType",a),S("keyOrValue",c),"string"==typeof c){var d=a[c];return d===b&&R("The enum key '{0}' does not exist.",c),d}if("number"==typeof c){for(var e in a)if(a[e]===c)return c;R("Invalid enum value '{0}'.",c)}else R("Invalid key or value type.")}function s(a,b,c){return B(a,b,c,v(c,1))}function t(a,b,c){return B(a,b,c,f(c,1))}function u(a,b,c,d){if((0>d||d>=c.stepCount)&&R(Y),!(b.forceMoveForward&&de||e>d.stepCount)&&R(Y),f=a.extend({},bb,f),y(b,e,f),d.currentIndex!==d.stepCount&&d.currentIndex>=e&&(d.currentIndex++,O(b,c,d)),d.stepCount++;var g=b.find(".content"),h=a("<{0}>{1}".format(c.headerTag,f.title)),i=a("<{0}>".format(c.bodyTag));return(null==f.contentMode||f.contentMode===$.html)&&i.html(f.content),0===e?g.prepend(i).prepend(h):k(b,e-1).after(i).after(h),K(b,d,i,e),N(b,c,d,h,e),F(b,c,d,e),e===d.currentIndex&&E(b,c,d),D(b,c,d),b}function y(a,b,c){o(a).splice(b,0,c)}function z(b){var c=a(this),d=m(c),e=n(c);if(d.suppressPaginationOnFocus&&c.find(":focus").is(":input"))return b.preventDefault(),!1;var f={left:37,right:39};b.keyCode===f.left?(b.preventDefault(),t(c,d,e)):b.keyCode===f.right&&(b.preventDefault(),s(c,d,e))}function A(b,c,d){if(d.stepCount>0){var e=d.currentIndex,f=p(b,e);if(!c.enableContentCache||!f.contentLoaded)switch(r($,f.contentMode)){case $.iframe:b.find(".content > .body").eq(d.currentIndex).empty().html('