You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
12 lines
12 KiB
12 lines
12 KiB
5 years ago
|
/*!
|
||
|
* SmartWizard v4.3.1
|
||
|
* The awesome jQuery step wizard plugin with Bootstrap support
|
||
|
* http://www.techlaboratory.net/smartwizard
|
||
|
*
|
||
|
* Created by Dipu Raj
|
||
|
* http://dipuraj.me
|
||
|
*
|
||
|
* Licensed under the terms of the MIT License
|
||
|
* https://github.com/techlab/SmartWizard/blob/master/LICENSE
|
||
|
*/
|
||
|
!function(t,s,e,n){"use strict";function i(s,e){this.options=t.extend(!0,{},o,e),this.main=t(s),this.nav=this.main.children("ul"),this.steps=t("li > a",this.nav),this.container=this.main.children("div"),this.pages=this.container.children("div"),this.current_index=null,this.options.toolbarSettings.toolbarButtonPosition="right"===this.options.toolbarSettings.toolbarButtonPosition?"end":this.options.toolbarSettings.toolbarButtonPosition,this.options.toolbarSettings.toolbarButtonPosition="left"===this.options.toolbarSettings.toolbarButtonPosition?"start":this.options.toolbarSettings.toolbarButtonPosition,this.options.theme=null===this.options.theme||""===this.options.theme?"default":this.options.theme,this.init()}var o={selected:0,keyNavigation:!0,autoAdjustHeight:!0,cycleSteps:!1,backButtonSupport:!0,useURLhash:!0,showStepURLhash:!0,lang:{next:"Next",previous:"Previous"},toolbarSettings:{toolbarPosition:"bottom",toolbarButtonPosition:"end",showNextButton:!0,showPreviousButton:!0,toolbarExtraButtons:[]},anchorSettings:{anchorClickable:!0,enableAllAnchors:!1,markDoneStep:!0,markAllPreviousStepsAsDone:!0,removeDoneStepOnNavigateBack:!1,enableAnchorOnDoneStep:!0},contentURL:null,contentCache:!0,ajaxSettings:{},disabledSteps:[],errorSteps:[],hiddenSteps:[],theme:"default",transitionEffect:"none",transitionSpeed:"400"};t.extend(i.prototype,{init:function(){this._setElements(),this._setToolbar(),this._setEvents();var e=this.options.selected;if(this.options.useURLhash){var n=s.location.hash;if(n&&n.length>0){var i=t("a[href*='"+n+"']",this.nav);if(i.length>0){var o=this.steps.index(i);e=o>=0?o:e}}}e>0&&this.options.anchorSettings.markDoneStep&&this.options.anchorSettings.markAllPreviousStepsAsDone&&this.steps.eq(e).parent("li").prevAll().addClass("done"),this._showStep(e)},_setElements:function(){this.main.addClass("sw-main sw-theme-"+this.options.theme),this.nav.addClass("nav nav-tabs step-anchor").children("li").addClass("nav-item").children("a").addClass("nav-link"),this.options.anchorSettings.enableAllAnchors!==!1&&this.options.anchorSettings.anchorClickable!==!1&&this.steps.parent("li").addClass("clickable"),this.container.addClass("sw-container tab-content"),this.pages.addClass("tab-pane step-content");var s=this;return this.options.disabledSteps&&this.options.disabledSteps.length>0&&t.each(this.options.disabledSteps,function(t,e){s.steps.eq(e).parent("li").addClass("disabled")}),this.options.errorSteps&&this.options.errorSteps.length>0&&t.each(this.options.errorSteps,function(t,e){s.steps.eq(e).parent("li").addClass("danger")}),this.options.hiddenSteps&&this.options.hiddenSteps.length>0&&t.each(this.options.hiddenSteps,function(t,e){s.steps.eq(e).parent("li").addClass("hidden")}),!0},_setToolbar:function(){if("none"===this.options.toolbarSettings.toolbarPosition)return!0;var s=this.options.toolbarSettings.showNextButton!==!1?t("<button></button>").text(this.options.lang.next).addClass("btn btn-secondary sw-btn-next").attr("type","button"):null,e=this.options.toolbarSettings.showPreviousButton!==!1?t("<button></button>").text(this.options.lang.previous).addClass("btn btn-secondary sw-btn-prev").attr("type","button"):null,n=t("<div></div>").addClass("btn-group mr-2 sw-btn-group").attr("role","group").append(e,s),i=null;this.options.toolbarSettings.toolbarExtraButtons&&this.options.toolbarSettings.toolbarExtraButtons.length>0&&(i=t("<div></div>").addClass("btn-group mr-2 sw-btn-group-extra").attr("role","group"),t.each(this.options.toolbarSettings.toolbarExtraButtons,function(t,s){i.append(s.clone(!0))}));var o,a;switch(this.options.toolbarSettings.toolbarPosition){case"top":o=t("<div></div>").addClass("btn-toolbar sw-toolbar sw-toolbar-top justify-content-"+this.options.toolbarSettings.toolbarButtonPosition),o.append(n),"start"===this.options.toolbarSettings.toolbarButtonPosition?o.prepend(i):o.append(i),this.container.before(o);break;case"bottom":a=t("<div></div>").addClass("btn-toolbar sw-toolbar sw-toolbar-bottom justify-content-"+this.options.toolbarSettings.toolbarButtonPosition),a.append(n),"start"===this.options.toolba
|