/*! * jQuery Steps v1.1.0 - 09/04/2014 * Copyright (c) 2014 Rafael Staib (http://www.jquery-steps.com) * Licensed under MIT http://www.opensource.org/licenses/MIT */ !(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 < h.length && R(Z, "titles"); var i = e.startIndex; if (((f.stepCount = g.length), e.saveState && a.cookie)) { var j = a.cookie(U + q(d)), k = parseInt(j, 0); !isNaN(k) && k < f.stepCount && (i = k); } (f.currentIndex = i), g.each(function (e) { var f = a(this), g = h.eq(e), i = g.data("mode"), j = null == i ? $.html : r($, /^\s*$/.test(i) || isNaN(i) ? i : parseInt(i, 0)), k = j === $.html || g.data("url") === b ? "" : g.data("url"), l = j !== $.html && "1" === g.data("loaded"), m = a.extend({}, bb, { title: f.html(), content: j === $.html ? g.html() : "", contentUrl: k, contentMode: j, contentLoaded: l, }); c(d, m); }); } function e(a) { a.triggerHandler("canceled"); } function f(a, b) { return a.currentIndex - b; } function g(b, c) { var d = i(b); b .unbind(d) .removeData("uid") .removeData("options") .removeData("state") .removeData("steps") .removeData("eventNamespace") .find(".actions a") .unbind(d), b.removeClass(c.clearFixCssClass + " vertical"); var e = b.find(".content > *"); 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}">{0}>'.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 && d < c.currentIndex)) ) { var e = c.currentIndex; return ( a.triggerHandler("stepChanging", [c.currentIndex, d]) ? ((c.currentIndex = d), O(a, b, c), E(a, b, c, e), D(a, b, c), A(a, b, c), P(a, b, c, d, e, function () { a.triggerHandler("stepChanged", [d, e]); })) : a.find(".steps li").eq(e).addClass("error"), !0 ); } } function v(a, b) { return a.currentIndex + b; } function w(b) { var c = a.extend(!0, {}, cb, b); return this.each(function () { var b = a(this), e = { currentIndex: c.startIndex, currentStep: null, stepCount: 0, transitionElement: null, }; b.data("options", c), b.data("state", e), b.data("steps", []), d(b, c, e), J(b, c, e), G(b, c), c.autoFocus && 0 === T && j(b, c.startIndex).focus(), b.triggerHandler("init", [c.startIndex]); }); } function x(b, c, d, e, f) { (0 > e || 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}{0}>".format(c.headerTag, f.title)), i = a("<{0}>{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( '' ) .data("loaded", "1"); break; case $.async: var g = k(b, e) ._aria("busy", "true") .empty() .append(M(c.loadingTemplate, { text: c.labels.loading })); a.ajax({ url: f.contentUrl, cache: !1 }).done(function (a) { g.empty().html(a)._aria("busy", "false").data("loaded", "1"), b.triggerHandler("contentLoaded", [e]); }); } } } function B(a, b, c, d) { var e = c.currentIndex; if ( d >= 0 && d < c.stepCount && !(b.forceMoveForward && d < c.currentIndex) ) { var f = j(a, d), g = f.parent(), h = g.hasClass("disabled"); return ( g._enableAria(), f.click(), e === c.currentIndex && h ? (g._enableAria(!1), !1) : !0 ); } return !1; } function C(b) { b.preventDefault(); var c = a(this), d = c.parent().parent().parent().parent(), f = m(d), g = n(d), i = c.attr("href"); switch (i.substring(i.lastIndexOf("#") + 1)) { case "cancel": e(d); break; case "finish": h(d, g); break; case "next": s(d, f, g); break; case "previous": t(d, f, g); } } function D(a, b, c) { if (b.enablePagination) { var d = a.find(".actions a[href$='#finish']").parent(), e = a.find(".actions a[href$='#next']").parent(); if (!b.forceMoveForward) { var f = a.find(".actions a[href$='#previous']").parent(); f._enableAria(c.currentIndex > 0); } b.enableFinishButton && b.showFinishButtonAlways ? (d._enableAria(c.stepCount > 0), e._enableAria(c.stepCount > 1 && c.stepCount > c.currentIndex + 1)) : (d._showAria( b.enableFinishButton && c.stepCount === c.currentIndex + 1 ), e ._showAria(0 === c.stepCount || c.stepCount > c.currentIndex + 1) ._enableAria( c.stepCount > c.currentIndex + 1 || !b.enableFinishButton )); } } function E(b, c, d, e) { var f = j(b, d.currentIndex), g = a( '' + c.labels.current + " " ), h = b.find(".content > .title"); if (null != e) { var i = j(b, e); i.parent().addClass("done").removeClass("error")._selectAria(!1), h.eq(e).removeClass("current").next(".body").removeClass("current"), (g = i.find(".current-info")), f.focus(); } f.prepend(g).parent()._selectAria().removeClass("done")._enableAria(), h .eq(d.currentIndex) .addClass("current") .next(".body") .addClass("current"); } function F(a, b, c, d) { for (var e = q(a), f = d; f < c.stepCount; f++) { var g = e + V + f, h = e + W + f, i = e + X + f, j = a.find(".title").eq(f)._id(i); a .find(".steps a") .eq(f) ._id(g) ._aria("controls", h) .attr("href", "#" + i) .html(M(b.titleTemplate, { index: f + 1, title: j.html() })), a.find(".body").eq(f)._id(h)._aria("labelledby", i); } } function G(a, b) { var c = i(a); a.bind("canceled" + c, b.onCanceled), a.bind("contentLoaded" + c, b.onContentLoaded), a.bind("finishing" + c, b.onFinishing), a.bind("finished" + c, b.onFinished), a.bind("init" + c, b.onInit), a.bind("stepChanging" + c, b.onStepChanging), a.bind("stepChanged" + c, b.onStepChanged), b.enableKeyNavigation && a.bind("keyup" + c, z), a.find(".actions a").bind("click" + c, C); } function H(a, b, c, d) { return 0 > d || d >= c.stepCount || c.currentIndex === d ? !1 : (I(a, d), c.currentIndex > d && (c.currentIndex--, O(a, b, c)), c.stepCount--, l(a, d).remove(), k(a, d).remove(), j(a, d).parent().remove(), 0 === d && a.find(".steps li").first().addClass("first"), d === c.stepCount && a.find(".steps li").eq(d).addClass("last"), F(a, b, c, d), D(a, b, c), !0); } function I(a, b) { o(a).splice(b, 1); } function J(b, c, d) { var e = '<{0} class="{1}">{2}{0}>', f = r(_, c.stepsOrientation), g = f === _.vertical ? " vertical" : "", h = a( e.format( c.contentContainerTag, "content " + c.clearFixCssClass, b.html() ) ), i = a( e.format( c.stepsContainerTag, "steps " + c.clearFixCssClass, '