diff --git a/CHANGELOG.md b/CHANGELOG.md
index de399a3..a136477 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,14 @@
# Changelog
+## 1.1.0
+
+- 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
+- Bug fix for having the same tag for titles and panels
+- AJAX crawling scheme support for SEO
+- History support for newer browsers (pushState) [#5](https://github.com/rstaib/jquery-steps/issues/5)
+- Dynamic height calculation [#8](https://github.com/rstaib/jquery-steps/issues/8)
+- AMD support
+
## 1.0.1
- Fixed an iframe border and scrolling issue for older browsers (IE8 and lower)
diff --git a/CNAME b/CNAME
deleted file mode 100644
index 64e4540..0000000
--- a/CNAME
+++ /dev/null
@@ -1 +0,0 @@
-www.jquery-steps.com
\ No newline at end of file
diff --git a/build/jquery.steps-1.0.1.zip b/build/jquery.steps-1.0.1.zip
deleted file mode 100644
index bd0519f..0000000
Binary files a/build/jquery.steps-1.0.1.zip and /dev/null differ
diff --git a/build/jquery.steps-1.1.0.zip b/build/jquery.steps-1.1.0.zip
new file mode 100644
index 0000000..97aae28
Binary files /dev/null and b/build/jquery.steps-1.1.0.zip differ
diff --git a/build/jquery.steps.js b/build/jquery.steps.js
index f7c5928..7441755 100644
--- a/build/jquery.steps.js
+++ b/build/jquery.steps.js
@@ -1,5 +1,5 @@
/*!
- * jQuery Steps v1.0.1 - 08/23/2013
+ * jQuery Steps v1.1.0 - 09/28/2013
* Copyright (c) 2013 Rafael Staib (http://www.jquery-steps.com)
* Licensed under MIT http://www.opensource.org/licenses/MIT
*/
@@ -111,6 +111,22 @@ function format(value)
return value;
}
+function getCurrentEnumKey(enumType, value)
+{
+ validateArgument("enumType", enumType);
+ validateArgument("value", value);
+
+ for (var key in enumType)
+ {
+ if (enumType[key] === value)
+ {
+ return key;
+ }
+ }
+
+ throwError("Invalid enum value '{0}'.", value);
+}
+
function getStepAnchor(wizard, index)
{
var uniqueId = getUniqueId(wizard);
@@ -165,7 +181,14 @@ function getUniqueId(wizard)
if (uniqueId == null)
{
- uniqueId = "steps-uid-".concat(++_uniqueId);
+ uniqueId = wizard._getId();
+ if (uniqueId == null)
+ {
+ uniqueId = "steps-uid-".concat(_uniqueId);
+ wizard._setId(uniqueId);
+ }
+
+ _uniqueId++;
wizard.data("uid", uniqueId);
}
@@ -614,6 +637,8 @@ function render(wizard, options, state)
var wrapperTemplate = "<{0} class=\"{1}\">{2}{0}>",
orientation = getValidEnumValue(stepsOrientation, options.stepsOrientation),
verticalCssClass = (orientation === stepsOrientation.vertical) ? " vertical" : "",
+ effect = getValidEnumValue(transitionEffect, options.transitionEffect),
+ effectCssClass = getCurrentEnumKey(transitionEffect, effect) + "Fx",
contentWrapper = $(format(wrapperTemplate, options.contentContainerTag, "content " + options.clearFixCssClass, wizard.html())),
stepsWrapper = $(format(wrapperTemplate, options.stepsContainerTag, "steps " + options.clearFixCssClass, "
")),
stepTitles = contentWrapper.children(options.headerTag),
@@ -621,7 +646,7 @@ function render(wizard, options, state)
wizard.attr("role", "application").empty().append(stepsWrapper).append(contentWrapper)
- .addClass(options.cssClass + " " + options.clearFixCssClass + verticalCssClass);
+ .addClass(options.cssClass + " " + effectCssClass + " " + options.clearFixCssClass + verticalCssClass);
stepContents.each(function (index)
@@ -997,6 +1022,8 @@ var defaults = $.fn.steps.defaults = {
autoFocus: false,
+ dynamicHeight: false,
+
enableAllSteps: false,
enableKeyNavigation: true,
@@ -1089,6 +1116,11 @@ $.fn.extend({
return this.removeClass("current")._aria("selected", "false");
},
+ _getId: function ()
+ {
+ return this.attr("id");
+ },
+
_setId: function (id)
{
return this.attr("id", id);
diff --git a/build/jquery.steps.min.js b/build/jquery.steps.min.js
index 93c9895..1a9603d 100644
--- a/build/jquery.steps.min.js
+++ b/build/jquery.steps.min.js
@@ -1,6 +1,6 @@
/*!
- * jQuery Steps v1.0.1 - 08/23/2013
+ * jQuery Steps v1.1.0 - 09/28/2013
* Copyright (c) 2013 Rafael Staib (http://www.jquery-steps.com)
* Licensed under MIT http://www.opensource.org/licenses/MIT
*/
-!function(a,b){function c(a,b){m(a).push(b)}function d(d,e,f){var g=d.children(e.headerTag),h=d.children(e.bodyTag);g.length>h.length?P(X,"contents"):g.lengthb||b>=c.length)&&P(W),c[b]}function o(a){var b=a.data("uid");return null==b&&(b="steps-uid-".concat(++R),a.data("uid",b)),b}function p(a,c){if(Q("enumType",a),Q("keyOrValue",c),"string"==typeof c){var d=a[c];return d===b&&P("The enum key '{0}' does not exist.",c),d}if("number"==typeof c){for(var e in a)if(a[e]===c)return c;P("Invalid enum value '{0}'.",c)}else P("Invalid key or value type.")}function q(a,b,c){return z(a,b,c,t(c,1))}function r(a,b,c){return z(a,b,c,e(c,1))}function s(a,b,c,d){if((0>d||d>=c.stepCount)&&P(W),!(b.forceMoveForward&&de||e>d.stepCount)&&P(W),f=a.extend({},_,f),w(b,e,f),d.currentIndex>=e&&(d.currentIndex++,M(b,c,d)),d.stepCount++;var h=b.find(".content"),j=a(g("<{0}>{1}{0}>",c.headerTag,f.title)),k=a(g("<{0}>{0}>",c.bodyTag));return(null==f.contentMode||f.contentMode===Y.html)&&k.html(f.content),0===e?h.prepend(k).prepend(j):i(b,e-1).after(k).after(j),I(b,k,e),L(b,c,d,j,e),D(b,c,d,e),B(b,c,d),b}function w(a,b,c){m(a).splice(b,0,c)}function x(b){var c=a(this),d=k(c),e=l(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(),r(c,d,e)):b.keyCode===f.right&&(b.preventDefault(),q(c,d,e))}function y(b,c,d){if(d.stepCount>0){var e=n(b,d.currentIndex);if(!c.enableContentCache||!e.contentLoaded)switch(p(Y,e.contentMode)){case Y.iframe:b.find(".content > .body").eq(d.currentIndex).empty().html('').data("loaded","1");break;case Y.async:var f=i(b,d.currentIndex)._aria("busy","true").empty().append(K(c.loadingTemplate,{text:c.labels.loading}));a.ajax({url:e.contentUrl,cache:!1}).done(function(a){f.empty().html(a)._aria("busy","false").data("loaded","1")})}}}function z(a,b,c,d){var e=c.currentIndex;if(d>=0&&d0?f._enableAria():f._disableAria()}b.enableFinishButton&&b.showFinishButtonAlways?0===c.stepCount?(d._disableAria(),e._disableAria()):c.stepCount>1&&c.stepCount>c.currentIndex+1?(d._enableAria(),e._enableAria()):(d._enableAria(),e._disableAria()):0===c.stepCount?(d._hideAria(),e._showAria()._disableAria()):c.stepCount>c.currentIndex+1?(d._hideAria(),e._showAria()._enableAria()):b.enableFinishButton?(d._showAria(),e._hideAria()):e._disableAria()}}function C(b,c,d,e){var f=h(b,d.currentIndex),g=a(''+c.labels.current+" "),i=b.find(".content > .title");if(null!=e){var j=h(b,e);j.parent().addClass("done").removeClass("error")._deselectAria(),i.eq(e).removeClass("current").next(".body").removeClass("current"),g=j.find(".current-info"),f.focus()}f.prepend(g).parent()._selectAria().removeClass("done")._enableAria(),i.eq(d.currentIndex).addClass("current").next(".body").addClass("current")}function D(a,b,c,d){for(var e=o(a),f=d;fd||d>=c.stepCount||c.currentIndex===d?!1:(G(a,d),c.currentIndex>d&&(c.currentIndex--,M(a,b,c)),c.stepCount--,j(a,d).remove(),i(a,d).remove(),h(a,d).parent().remove(),0===d&&a.find(".steps li").first().addClass("first"),d===c.stepCount&&a.find(".steps li").eq(d).addClass("last"),D(a,b,c,d),B(a,b,c),!0)}function G(a,b){m(a).splice(b,1)}function H(b,c,d){var e='<{0} class="{1}">{2}{0}>',f=p(Z,c.stepsOrientation),h=f===Z.vertical?" vertical":"",i=a(g(e,c.contentContainerTag,"content "+c.clearFixCssClass,b.html())),j=a(g(e,c.stepsContainerTag,"steps "+c.clearFixCssClass,'')),k=i.children(c.headerTag),l=i.children(c.bodyTag);b.attr("role","application").empty().append(j).append(i).addClass(c.cssClass+" "+c.clearFixCssClass+h),l.each(function(c){I(b,a(this),c)}),l.eq(d.currentIndex)._showAria(),k.each(function(e){L(b,c,d,a(this),e)}),C(b,c,d),J(b,c,d)}function I(a,b,c){var d=o(a),e=d+U+c,f=d+V+c;b._setId(e).attr("role","tabpanel")._aria("labelledby",f).addClass("body")._hideAria()}function J(a,b,c){if(b.enablePagination){var d='<{0} class="actions {1}">{0}>',e='{1}',f="";b.forceMoveForward||(f+=g(e,"previous",b.labels.previous)),f+=g(e,"next",b.labels.next),b.enableFinishButton&&(f+=g(e,"finish",b.labels.finish)),a.append(g(d,b.actionContainerTag,b.clearFixCssClass,b.labels.pagination,f)),B(a,b,c),y(a,b,c)}}function K(a,c){for(var d=a.match(/#([a-z]*)#/gi),e=0;e ul"),l=K(c.titleTemplate,{index:f+1,title:e.html()}),m=a(''+l+"");c.enableAllSteps||m._disableAria(),d.currentIndex>f&&m._enableAria().addClass("done"),e._setId(j).attr("tabindex","-1").addClass("title"),0===f?k.prepend(m):k.find("li").eq(f-1).after(m),0===f&&k.find("li").removeClass("first").eq(f).addClass("first"),f===d.stepCount-1&&k.find("li").removeClass("last").eq(f).addClass("last"),m.children("a").bind("click.steps",O)}function M(b,c,d){c.saveState&&a.cookie&&a.cookie(S+o(b),d.currentIndex)}function N(b,c,d,e,f){var g=b.find(".content > .body"),h=p($,c.transitionEffect),i=c.transitionEffectSpeed,j=g.eq(e),k=g.eq(f);switch(h){case $.fade:case $.slide:var m=h===$.fade?"fadeOut":"slideUp",n=h===$.fade?"fadeIn":"slideDown";d.transitionElement=j,k[m](i,function(){var b=a(this)._hideAria().parent().parent(),c=l(b);c.transitionElement&&(c.transitionElement[n](i,function(){a(this)._showAria()}),c.transitionElement=null)}).promise();break;case $.slideLeft:var o=k.outerWidth(!0),q=e>f?-o:o,r=e>f?o:-o;k.animate({left:q},i,function(){a(this)._hideAria()}).promise(),j.css("left",r+"px")._showAria().animate({left:0},i).promise();break;default:k._hideAria(),j._showAria()}}function O(b){b.preventDefault();var c=a(this),d=c.parent().parent().parent().parent(),e=k(d),f=l(d),g=f.currentIndex;if(c.parent().is(":not(.disabled):not(.current)")){var i=c.attr("href"),j=parseInt(i.substring(i.lastIndexOf("-")+1),0);s(d,e,f,j)}return g===f.currentIndex?(h(d,g).focus(),!1):void 0}function P(a){throw arguments.length>1&&(a=g.apply(this,arguments)),new Error(a)}function Q(a,b){null==b&&P("The argument '{0}' is null or undefined.",a)}var R=0,S="jQu3ry_5teps_St@te_",T="-t-",U="-p-",V="-h-",W="Index out of range.",X="One or more corresponding step {0} are missing.";a.fn.steps=function(b){return a.fn.steps[b]?a.fn.steps[b].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof b&&b?(a.error("Method "+b+" does not exist on jQuery.steps"),void 0):u.apply(this,arguments)},a.fn.steps.add=function(a){var b=k(this),c=l(this);return v(this,b,c,c.stepCount,a)},a.fn.steps.finish=function(){var a=l(this);f(this,a)},a.fn.steps.getCurrentIndex=function(){return l(this).currentIndex},a.fn.steps.getCurrentStep=function(){return n(this,l(this).currentIndex)},a.fn.steps.getStep=function(a){return n(this,a)},a.fn.steps.insert=function(a,b){var c=k(this),d=l(this);return v(this,c,d,a,b)},a.fn.steps.next=function(){var a=k(this),b=l(this);return q(this,a,b)},a.fn.steps.previous=function(){var a=k(this),b=l(this);return r(this,a,b)},a.fn.steps.remove=function(a){var b=k(this),c=l(this);return F(this,b,c,a)},a.fn.steps.setStep=function(){throw new Error("Not yet implemented!")},a.fn.steps.skip=function(){throw new Error("Not yet implemented!")};var Y=a.fn.steps.contentMode={html:0,iframe:1,async:2},Z=a.fn.steps.stepsOrientation={horizontal:0,vertical:1},$=a.fn.steps.transitionEffect={none:0,fade:1,slide:2,slideLeft:3},_=a.fn.steps.stepModel={title:"",content:"",contentUrl:"",contentMode:Y.html,contentLoaded:!1},ab=a.fn.steps.defaults={headerTag:"h1",bodyTag:"div",contentContainerTag:"div",actionContainerTag:"div",stepsContainerTag:"div",cssClass:"wizard",clearFixCssClass:"clearfix",stepsOrientation:Z.horizontal,titleTemplate:'#index#. #title#',loadingTemplate:' #text#',autoFocus:!1,enableAllSteps:!1,enableKeyNavigation:!0,enablePagination:!0,suppressPaginationOnFocus:!0,enableContentCache:!0,enableFinishButton:!0,preloadContent:!1,showFinishButtonAlways:!1,forceMoveForward:!1,saveState:!1,startIndex:0,transitionEffect:$.none,transitionEffectSpeed:200,onStepChanging:function(){return!0},onStepChanged:function(){},onFinishing:function(){return!0},onFinished:function(){},labels:{current:"current step:",pagination:"Pagination",finish:"Finish",next:"Next",previous:"Previous",loading:"Loading ..."}};a.fn.extend({_aria:function(a,b){return this.attr("aria-"+a,b)},_removeAria:function(a){return this.removeAttr("aria-"+a)},_enableAria:function(){return this.removeClass("disabled")._aria("disabled","false")},_disableAria:function(){return this.addClass("disabled")._aria("disabled","true")},_hideAria:function(){return this.hide()._aria("hidden","true")},_showAria:function(){return this.show()._aria("hidden","false")},_selectAria:function(){return this.addClass("current")._aria("selected","true")},_deselectAria:function(){return this.removeClass("current")._aria("selected","false")},_setId:function(a){return this.attr("id",a)}})}(jQuery);
\ No newline at end of file
+!function(a,b){function c(a,b){n(a).push(b)}function d(d,e,f){var g=d.children(e.headerTag),h=d.children(e.bodyTag);g.length>h.length?Q(Y,"contents"):g.lengthb||b>=c.length)&&Q(X),c[b]}function p(a){var b=a.data("uid");return null==b&&(b=a._getId(),null==b&&(b="steps-uid-".concat(S),a._setId(b)),S++,a.data("uid",b)),b}function q(a,c){if(R("enumType",a),R("keyOrValue",c),"string"==typeof c){var d=a[c];return d===b&&Q("The enum key '{0}' does not exist.",c),d}if("number"==typeof c){for(var e in a)if(a[e]===c)return c;Q("Invalid enum value '{0}'.",c)}else Q("Invalid key or value type.")}function r(a,b,c){return A(a,b,c,u(c,1))}function s(a,b,c){return A(a,b,c,e(c,1))}function t(a,b,c,d){if((0>d||d>=c.stepCount)&&Q(X),!(b.forceMoveForward&&de||e>d.stepCount)&&Q(X),f=a.extend({},ab,f),x(b,e,f),d.currentIndex>=e&&(d.currentIndex++,N(b,c,d)),d.stepCount++;var h=b.find(".content"),i=a(g("<{0}>{1}{0}>",c.headerTag,f.title)),k=a(g("<{0}>{0}>",c.bodyTag));return(null==f.contentMode||f.contentMode===Z.html)&&k.html(f.content),0===e?h.prepend(k).prepend(i):j(b,e-1).after(k).after(i),J(b,k,e),M(b,c,d,i,e),E(b,c,d,e),C(b,c,d),b}function x(a,b,c){n(a).splice(b,0,c)}function y(b){var c=a(this),d=l(c),e=m(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(),s(c,d,e)):b.keyCode===f.right&&(b.preventDefault(),r(c,d,e))}function z(b,c,d){if(d.stepCount>0){var e=o(b,d.currentIndex);if(!c.enableContentCache||!e.contentLoaded)switch(q(Z,e.contentMode)){case Z.iframe:b.find(".content > .body").eq(d.currentIndex).empty().html('').data("loaded","1");break;case Z.async:var f=j(b,d.currentIndex)._aria("busy","true").empty().append(L(c.loadingTemplate,{text:c.labels.loading}));a.ajax({url:e.contentUrl,cache:!1}).done(function(a){f.empty().html(a)._aria("busy","false").data("loaded","1")})}}}function A(a,b,c,d){var e=c.currentIndex;if(d>=0&&d0?f._enableAria():f._disableAria()}b.enableFinishButton&&b.showFinishButtonAlways?0===c.stepCount?(d._disableAria(),e._disableAria()):c.stepCount>1&&c.stepCount>c.currentIndex+1?(d._enableAria(),e._enableAria()):(d._enableAria(),e._disableAria()):0===c.stepCount?(d._hideAria(),e._showAria()._disableAria()):c.stepCount>c.currentIndex+1?(d._hideAria(),e._showAria()._enableAria()):b.enableFinishButton?(d._showAria(),e._hideAria()):e._disableAria()}}function D(b,c,d,e){var f=i(b,d.currentIndex),g=a(''+c.labels.current+" "),h=b.find(".content > .title");if(null!=e){var j=i(b,e);j.parent().addClass("done").removeClass("error")._deselectAria(),h.eq(e).removeClass("current").next(".body").removeClass("current"),g=j.find(".current-info"),f.focus()}f.prepend(g).parent()._selectAria().removeClass("done")._enableAria(),h.eq(d.currentIndex).addClass("current").next(".body").addClass("current")}function E(a,b,c,d){for(var e=p(a),f=d;fd||d>=c.stepCount||c.currentIndex===d?!1:(H(a,d),c.currentIndex>d&&(c.currentIndex--,N(a,b,c)),c.stepCount--,k(a,d).remove(),j(a,d).remove(),i(a,d).parent().remove(),0===d&&a.find(".steps li").first().addClass("first"),d===c.stepCount&&a.find(".steps li").eq(d).addClass("last"),E(a,b,c,d),C(a,b,c),!0)}function H(a,b){n(a).splice(b,1)}function I(b,c,d){var e='<{0} class="{1}">{2}{0}>',f=q($,c.stepsOrientation),i=f===$.vertical?" vertical":"",j=q(_,c.transitionEffect),k=h(_,j)+"Fx",l=a(g(e,c.contentContainerTag,"content "+c.clearFixCssClass,b.html())),m=a(g(e,c.stepsContainerTag,"steps "+c.clearFixCssClass,'')),n=l.children(c.headerTag),o=l.children(c.bodyTag);b.attr("role","application").empty().append(m).append(l).addClass(c.cssClass+" "+k+" "+c.clearFixCssClass+i),o.each(function(c){J(b,a(this),c)}),o.eq(d.currentIndex)._showAria(),n.each(function(e){M(b,c,d,a(this),e)}),D(b,c,d),K(b,c,d)}function J(a,b,c){var d=p(a),e=d+V+c,f=d+W+c;b._setId(e).attr("role","tabpanel")._aria("labelledby",f).addClass("body")._hideAria()}function K(a,b,c){if(b.enablePagination){var d='<{0} class="actions {1}">{0}>',e='{1}',f="";b.forceMoveForward||(f+=g(e,"previous",b.labels.previous)),f+=g(e,"next",b.labels.next),b.enableFinishButton&&(f+=g(e,"finish",b.labels.finish)),a.append(g(d,b.actionContainerTag,b.clearFixCssClass,b.labels.pagination,f)),C(a,b,c),z(a,b,c)}}function L(a,c){for(var d=a.match(/#([a-z]*)#/gi),e=0;e ul"),l=L(c.titleTemplate,{index:f+1,title:e.html()}),m=a(''+l+"");c.enableAllSteps||m._disableAria(),d.currentIndex>f&&m._enableAria().addClass("done"),e._setId(j).attr("tabindex","-1").addClass("title"),0===f?k.prepend(m):k.find("li").eq(f-1).after(m),0===f&&k.find("li").removeClass("first").eq(f).addClass("first"),f===d.stepCount-1&&k.find("li").removeClass("last").eq(f).addClass("last"),m.children("a").bind("click.steps",P)}function N(b,c,d){c.saveState&&a.cookie&&a.cookie(T+p(b),d.currentIndex)}function O(b,c,d,e,f){var g=b.find(".content > .body"),h=q(_,c.transitionEffect),i=c.transitionEffectSpeed,j=g.eq(e),k=g.eq(f);switch(h){case _.fade:case _.slide:var l=h===_.fade?"fadeOut":"slideUp",n=h===_.fade?"fadeIn":"slideDown";d.transitionElement=j,k[l](i,function(){var b=a(this)._hideAria().parent().parent(),c=m(b);c.transitionElement&&(c.transitionElement[n](i,function(){a(this)._showAria()}),c.transitionElement=null)}).promise();break;case _.slideLeft:var o=k.outerWidth(!0),p=e>f?-o:o,r=e>f?o:-o;k.animate({left:p},i,function(){a(this)._hideAria()}).promise(),j.css("left",r+"px")._showAria().animate({left:0},i).promise();break;default:k._hideAria(),j._showAria()}}function P(b){b.preventDefault();var c=a(this),d=c.parent().parent().parent().parent(),e=l(d),f=m(d),g=f.currentIndex;if(c.parent().is(":not(.disabled):not(.current)")){var h=c.attr("href"),j=parseInt(h.substring(h.lastIndexOf("-")+1),0);t(d,e,f,j)}return g===f.currentIndex?(i(d,g).focus(),!1):void 0}function Q(a){throw arguments.length>1&&(a=g.apply(this,arguments)),new Error(a)}function R(a,b){null==b&&Q("The argument '{0}' is null or undefined.",a)}var S=0,T="jQu3ry_5teps_St@te_",U="-t-",V="-p-",W="-h-",X="Index out of range.",Y="One or more corresponding step {0} are missing.";a.fn.steps=function(b){return a.fn.steps[b]?a.fn.steps[b].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof b&&b?(a.error("Method "+b+" does not exist on jQuery.steps"),void 0):v.apply(this,arguments)},a.fn.steps.add=function(a){var b=l(this),c=m(this);return w(this,b,c,c.stepCount,a)},a.fn.steps.finish=function(){var a=m(this);f(this,a)},a.fn.steps.getCurrentIndex=function(){return m(this).currentIndex},a.fn.steps.getCurrentStep=function(){return o(this,m(this).currentIndex)},a.fn.steps.getStep=function(a){return o(this,a)},a.fn.steps.insert=function(a,b){var c=l(this),d=m(this);return w(this,c,d,a,b)},a.fn.steps.next=function(){var a=l(this),b=m(this);return r(this,a,b)},a.fn.steps.previous=function(){var a=l(this),b=m(this);return s(this,a,b)},a.fn.steps.remove=function(a){var b=l(this),c=m(this);return G(this,b,c,a)},a.fn.steps.setStep=function(){throw new Error("Not yet implemented!")},a.fn.steps.skip=function(){throw new Error("Not yet implemented!")};var Z=a.fn.steps.contentMode={html:0,iframe:1,async:2},$=a.fn.steps.stepsOrientation={horizontal:0,vertical:1},_=a.fn.steps.transitionEffect={none:0,fade:1,slide:2,slideLeft:3},ab=a.fn.steps.stepModel={title:"",content:"",contentUrl:"",contentMode:Z.html,contentLoaded:!1},bb=a.fn.steps.defaults={headerTag:"h1",bodyTag:"div",contentContainerTag:"div",actionContainerTag:"div",stepsContainerTag:"div",cssClass:"wizard",clearFixCssClass:"clearfix",stepsOrientation:$.horizontal,titleTemplate:'#index#. #title#',loadingTemplate:' #text#',autoFocus:!1,dynamicHeight:!1,enableAllSteps:!1,enableKeyNavigation:!0,enablePagination:!0,suppressPaginationOnFocus:!0,enableContentCache:!0,enableFinishButton:!0,preloadContent:!1,showFinishButtonAlways:!1,forceMoveForward:!1,saveState:!1,startIndex:0,transitionEffect:_.none,transitionEffectSpeed:200,onStepChanging:function(){return!0},onStepChanged:function(){},onFinishing:function(){return!0},onFinished:function(){},labels:{current:"current step:",pagination:"Pagination",finish:"Finish",next:"Next",previous:"Previous",loading:"Loading ..."}};a.fn.extend({_aria:function(a,b){return this.attr("aria-"+a,b)},_removeAria:function(a){return this.removeAttr("aria-"+a)},_enableAria:function(){return this.removeClass("disabled")._aria("disabled","false")},_disableAria:function(){return this.addClass("disabled")._aria("disabled","true")},_hideAria:function(){return this.hide()._aria("hidden","true")},_showAria:function(){return this.show()._aria("hidden","false")},_selectAria:function(){return this.addClass("current")._aria("selected","true")},_deselectAria:function(){return this.removeClass("current")._aria("selected","false")},_getId:function(){return this.attr("id")},_setId:function(a){return this.attr("id",a)}})}(jQuery);
\ No newline at end of file
diff --git a/demo/css/jquery.steps.css b/demo/css/jquery.steps.css
index b52eb8a..4daaae7 100644
--- a/demo/css/jquery.steps.css
+++ b/demo/css/jquery.steps.css
@@ -1,138 +1,275 @@
-.wizard
+/*
+ Common
+*/
+
+.wizard,
+.tabcontrol
{
- width: 600px;
+ display: block;
+ width: 100%;
+ overflow: hidden;
}
-
-
-/* Common */
-.wizard a
+.wizard a,
+.tabcontrol a
{
outline: 0;
}
-.wizard ol,
-.wizard ul
+.wizard ul,
+.tabcontrol ul
{
- list-style: none;
+ list-style: none !important;
+ padding: 0;
+ margin: 0;
}
-
+.wizard ul > li,
+.tabcontrol ul > li
+{
+ display: block;
+ padding: 0;
+}
/* Accessibility */
-.wizard .audible
+.wizard > .steps .current-info,
+.tabcontrol > .steps .current-info
{
position: absolute;
left: -999em;
}
+.wizard > .content > .title,
+.tabcontrol > .content > .title
+{
+ position: absolute;
+ left: -999em;
+}
+
+
+
+/*
+ Wizard
+*/
.wizard > .steps
{
- background: #fff;
- width: 600px;
- height: 30px;
position: relative;
+ display: block;
+ width: 100%;
}
.wizard.vertical > .steps
{
+ display: inline;
float: left;
- width: 200px;
- height: 330px;
+ width: 30%;
}
.wizard > .steps .number
{
- font-size: 22px;
- font-weight: bold;
+ font-size: 1.429em;
+}
+
+.wizard > .steps > ul > li
+{
+ width: 25%;
}
-.wizard li[role="tab"],
-.wizard > .actions li
+.wizard > .steps > ul > li,
+.wizard > .actions > ul > li
{
float: left;
}
-.wizard li[role="tab"] a
+.wizard.vertical > .steps > ul > li
{
- background: #999;
+ float: none;
+ width: 100%;
}
-.wizard li[role="tab"].disabled a
+.wizard > .steps a,
+.wizard > .steps a:hover,
+.wizard > .steps a:active
{
- background: #ccc;
+ display: block;
+ width: auto;
+ margin: 0 0.5em 0.5em;
+ padding: 1em 1em;
+ text-decoration: none;
+
+ -webkit-border-radius: 5px;
+ -moz-border-radius: 5px;
+ border-radius: 5px;
+}
+
+.wizard > .steps .disabled a,
+.wizard > .steps .disabled a:hover,
+.wizard > .steps .disabled a:active
+{
+ background: #eee;
+ color: #aaa;
cursor: default;
}
-.wizard li[role="tab"].current a
+.wizard > .steps .current a,
+.wizard > .steps .current a:hover,
+.wizard > .steps .current a:active
{
- background: rgb(241, 101, 41);
+ background: #2184be;
+ color: #fff;
cursor: default;
}
-.wizard li[role="tab"].done a
+.wizard > .steps .done a,
+.wizard > .steps .done a:hover,
+.wizard > .steps .done a:active
{
- background: #4cff00;
+ background: #9dc8e2;
+ color: #fff;
}
-.wizard li[role="tab"].error a
+.wizard > .steps .error a,
+.wizard > .steps .error a:hover,
+.wizard > .steps .error a:active
{
- background: #f00;
+ background: #ff3111;
+ color: #fff;
}
.wizard > .content
{
- width: 600px;
- height: 300px;
+ background: #eee;
+ display: block;
+ margin: 0.5em;
+ min-height: 35em;
overflow: hidden;
position: relative;
+ width: auto;
+
+ -webkit-border-radius: 5px;
+ -moz-border-radius: 5px;
+ border-radius: 5px;
}
.wizard.vertical > .content
{
+ display: inline;
float: left;
- width: 400px;
- height: 330px;
+ margin: 0 2.5% 0.5em 2.5%;
+ width: 65%;
}
-.wizard > .content > .title
+.wizard > .content > .body
{
+ background: #f00;
+ float: left;
position: absolute;
- left: -999em;
+ width: 95%;
+ height: 95%;
+ padding: 2.5%;
}
-.wizard > .content > .body
+.wizard > .content > .body ul
{
- border: 1px solid #CCC;
- float: left;
- position: absolute;
- width: 600px;
- height: 300px;
- z-index: -1;
+ list-style: disc !important;
}
-.wizard.vertical > .content > .body
+.wizard > .content > .body ul > li
{
- width: 400px;
+ display: list-item;
}
.wizard > .content > .body > iframe
{
border: 0 none;
width: 100%;
- height: 200px;
+ height: 100%;
+}
+
+.wizard > .content > .body input
+{
+ display: block;
+ border: 1px solid #ccc;
+}
+
+.wizard > .content > .body input[type="checkbox"]
+{
+ display: inline-block;
+}
+
+.wizard > .content > .body input.error
+{
+ background: rgb(251, 227, 228);
+ border: 1px solid #fbc2c4;
+ color: #8a1f11;
+}
+
+.wizard > .content > .body label
+{
+ display: inline-block;
+ margin-bottom: 0.5em;
+}
+
+.wizard > .content > .body label.error
+{
+ color: #8a1f11;
+ display: inline-block;
+ margin-left: 1.5em;
}
.wizard > .actions
{
- width: 600px;
- height: 30px;
position: relative;
+ display: block;
+ text-align: right;
+ width: 100%;
+}
+
+.wizard.vertical > .actions
+{
+ display: inline;
+ float: right;
+ margin: 0 2.5%;
+ width: 95%;
+}
+
+.wizard > .actions > ul
+{
+ display: inline-block;
+ text-align: right;
+}
+
+.wizard > .actions > ul > li
+{
+ margin: 0 0.5em;
+}
+
+.wizard.vertical > .actions > ul > li
+{
+ margin: 0 0 0 1em;
+}
+
+.wizard > .actions a,
+.wizard > .actions a:hover,
+.wizard > .actions a:active
+{
+ background: #2184be;
+ color: #fff;
+ display: block;
+ padding: 0.5em 1em;
+ text-decoration: none;
+
+ -webkit-border-radius: 5px;
+ -moz-border-radius: 5px;
+ border-radius: 5px;
}
-.wizard > .actions [aria-disabled="true"] a
+.wizard > .actions .disabled a,
+.wizard > .actions .disabled a:hover,
+.wizard > .actions .disabled a:active
{
+ background: #eee;
color: #aaa;
}
@@ -142,4 +279,105 @@
.wizard > .loading .spinner
{
+}
+
+
+
+/*
+ Tabcontrol
+*/
+
+.tabcontrol > .steps
+{
+ position: relative;
+ display: block;
+ width: 100%;
+}
+
+.tabcontrol > .steps > ul
+{
+ position: relative;
+ margin: 6px 0 0 0;
+ top: 1px;
+ z-index: 1;
+}
+
+.tabcontrol > .steps > ul > li
+{
+ float: left;
+ margin: 5px 2px 0 0;
+ padding: 1px;
+
+ -webkit-border-top-left-radius: 5px;
+ -webkit-border-top-right-radius: 5px;
+ -moz-border-radius-topleft: 5px;
+ -moz-border-radius-topright: 5px;
+ border-top-left-radius: 5px;
+ border-top-right-radius: 5px;
+}
+
+.tabcontrol > .steps > ul > li:hover
+{
+ background: #edecec;
+ border: 1px solid #bbb;
+ padding: 0;
+}
+
+.tabcontrol > .steps > ul > li.current
+{
+ background: #fff;
+ border: 1px solid #bbb;
+ border-bottom: 0 none;
+ padding: 0 0 1px 0;
+ margin-top: 0;
+}
+
+.tabcontrol > .steps > ul > li > a
+{
+ color: #5f5f5f;
+ display: inline-block;
+ border: 0 none;
+ margin: 0;
+ padding: 10px 30px;
+ text-decoration: none;
+}
+
+.tabcontrol > .steps > ul > li > a:hover
+{
+ text-decoration: none;
+}
+
+.tabcontrol > .steps > ul > li.current > a
+{
+ padding: 15px 30px 10px 30px;
+}
+
+.tabcontrol > .content
+{
+ position: relative;
+ display: inline-block;
+ width: 100%;
+ height: 35em;
+ overflow: hidden;
+ border-top: 1px solid #bbb;
+ padding-top: 20px;
+}
+
+.tabcontrol > .content > .body
+{
+ float: left;
+ position: absolute;
+ width: 95%;
+ height: 95%;
+ padding: 2.5%;
+}
+
+.tabcontrol > .content > .body ul
+{
+ list-style: disc !important;
+}
+
+.tabcontrol > .content > .body ul > li
+{
+ display: list-item;
}
\ No newline at end of file
diff --git a/package.json b/package.json
index c009a52..e0d105f 100644
--- a/package.json
+++ b/package.json
@@ -1,7 +1,7 @@
{
"name": "jquery-steps",
"title": "jQuery Steps",
- "version": "1.0.1",
+ "version": "1.1.0",
"description": "A powerful jQuery wizard plugin that supports accessibility and HTML5",
"homepage": "http://www.jquery-steps.com",
"author": {
@@ -39,8 +39,8 @@
"grunt-contrib-concat": "~0.3.0",
"grunt-contrib-yuidoc": "~0.4.0",
"grunt-contrib-clean": "~0.4.1",
- "grunt-regex-replace": "~0.2.5",
- "grunt-contrib-compress": "~0.5.2"
+ "grunt-contrib-compress": "~0.5.2",
+ "grunt-regex-replace": "~0.2.5"
},
"readmeFilename": "README.md",
"gitHead": "0d9f4f8b6a0c3d3b8a73eabf6a4b8cececd52f7a",
@@ -49,4 +49,4 @@
"src": "src",
"docs": "docs"
}
-}
+}
\ No newline at end of file
diff --git a/src/defaults.js b/src/defaults.js
index a580e08..b030fe4 100644
--- a/src/defaults.js
+++ b/src/defaults.js
@@ -89,12 +89,13 @@ var defaults = $.fn.steps.defaults = {
clearFixCssClass: "clearfix",
/**
- * The css class which will be used for floating scenarios.
+ * Determines whether the steps are vertically or horizontally oriented.
*
- * @property clearFixCssClass
- * @type String
- * @default "clearfix"
+ * @property stepsOrientation
+ * @type stepsOrientation
+ * @default horizontal
* @for defaults
+ * @since 1.0.0
**/
stepsOrientation: stepsOrientation.horizontal,
@@ -137,6 +138,17 @@ var defaults = $.fn.steps.defaults = {
**/
autoFocus: false,
+ /**
+ * Determines whether the step panels height is dynamically calculated.
+ *
+ * @property dynamicHeight
+ * @type Boolean
+ * @default false
+ * @for defaults
+ * @since 1.1.0
+ **/
+ dynamicHeight: false,
+
/**
* Enables all steps from the begining if `true` (all steps are clickable).
*
diff --git a/src/helper.js b/src/helper.js
index ce0cf76..72ab3f0 100644
--- a/src/helper.js
+++ b/src/helper.js
@@ -39,6 +39,11 @@ $.fn.extend({
return this.removeClass("current")._aria("selected", "false");
},
+ _getId: function ()
+ {
+ return this.attr("id");
+ },
+
_setId: function (id)
{
return this.attr("id", id);
diff --git a/src/privates.js b/src/privates.js
index 0ad7e93..8860fc7 100644
--- a/src/privates.js
+++ b/src/privates.js
@@ -181,6 +181,22 @@ function format(value)
return value;
}
+function getCurrentEnumKey(enumType, value)
+{
+ validateArgument("enumType", enumType);
+ validateArgument("value", value);
+
+ for (var key in enumType)
+ {
+ if (enumType[key] === value)
+ {
+ return key;
+ }
+ }
+
+ throwError("Invalid enum value '{0}'.", value);
+}
+
function getStepAnchor(wizard, index)
{
var uniqueId = getUniqueId(wizard);
@@ -253,7 +269,14 @@ function getUniqueId(wizard)
if (uniqueId == null)
{
- uniqueId = "steps-uid-".concat(++_uniqueId);
+ uniqueId = wizard._getId();
+ if (uniqueId == null)
+ {
+ uniqueId = "steps-uid-".concat(_uniqueId);
+ wizard._setId(uniqueId);
+ }
+
+ _uniqueId++;
wizard.data("uid", uniqueId);
}
@@ -876,6 +899,8 @@ function render(wizard, options, state)
var wrapperTemplate = "<{0} class=\"{1}\">{2}{0}>",
orientation = getValidEnumValue(stepsOrientation, options.stepsOrientation),
verticalCssClass = (orientation === stepsOrientation.vertical) ? " vertical" : "",
+ effect = getValidEnumValue(transitionEffect, options.transitionEffect),
+ effectCssClass = getCurrentEnumKey(transitionEffect, effect) + "Fx",
contentWrapper = $(format(wrapperTemplate, options.contentContainerTag, "content " + options.clearFixCssClass, wizard.html())),
stepsWrapper = $(format(wrapperTemplate, options.stepsContainerTag, "steps " + options.clearFixCssClass, "")),
stepTitles = contentWrapper.children(options.headerTag),
@@ -883,7 +908,7 @@ function render(wizard, options, state)
// Transform the wizard wrapper and remove the inner HTML
wizard.attr("role", "application").empty().append(stepsWrapper).append(contentWrapper)
- .addClass(options.cssClass + " " + options.clearFixCssClass + verticalCssClass);
+ .addClass(options.cssClass + " " + effectCssClass + " " + options.clearFixCssClass + verticalCssClass);
// Add WIA-ARIA support
stepContents.each(function (index)
diff --git a/steps.jquery.json b/steps.jquery.json
index 4992548..64ab495 100644
--- a/steps.jquery.json
+++ b/steps.jquery.json
@@ -14,7 +14,7 @@
"tabs",
"steps"
],
- "version": "1.0.1",
+ "version": "1.1.0",
"author": {
"name": "Rafael Staib",
"email": "me@rafaelstaib.com",