Files
RuoYi/ruoyi-admin/src/main/resources/static/ajax/libs/staps/jquery.steps.min.js

6 lines
22 KiB
JavaScript
Raw Normal View History

2019-06-03 09:19:57 +08:00
/*!
* 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($,undefined){$.fn.extend({_aria:function(name,value){return this.attr("aria-"+name,value)},_removeAria:function(name){return this.removeAttr("aria-"+name)},_enableAria:function(enable){return(enable==null||enable)?this.removeClass("disabled")._aria("disabled","false"):this.addClass("disabled")._aria("disabled","true")},_showAria:function(show){return(show==null||show)?this.show()._aria("hidden","false"):this.hide()._aria("hidden","true")},_selectAria:function(select){return(select==null||select)?this.addClass("current")._aria("selected","true"):this.removeClass("current")._aria("selected","false")},_id:function(id){return(id)?this.attr("id",id):this.attr("id")}});if(!String.prototype.format){String.prototype.format=function(){var args=(arguments.length===1&&$.isArray(arguments[0]))?arguments[0]:arguments;var formattedString=this;for(var i=0;i<args.length;i++){var pattern=new RegExp("\\{"+i+"\\}","gm");formattedString=formattedString.replace(pattern,args[i])}return formattedString}}var _uniqueId=0;var _cookiePrefix="jQu3ry_5teps_St@te_";var _tabSuffix="-t-";var _tabpanelSuffix="-p-";var _titleSuffix="-h-";var _indexOutOfRangeErrorMessage="Index out of range.";var _missingCorrespondingElementErrorMessage="One or more corresponding step {0} are missing.";function addStepToCache(wizard,step){getSteps(wizard).push(step)}function analyzeData(wizard,options,state){var stepTitles=wizard.children(options.headerTag),stepContents=wizard.children(options.bodyTag);if(stepTitles.length>stepContents.length){throwError(_missingCorrespondingElementErrorMessage,"contents")}else{if(stepTitles.length<stepContents.length){throwError(_missingCorrespondingElementErrorMessage,"titles")}}var startIndex=options.startIndex;state.stepCount=stepTitles.length;if(options.saveState&&$.cookie){var savedState=$.cookie(_cookiePrefix+getUniqueId(wizard));var savedIndex=parseInt(savedState,0);if(!isNaN(savedIndex)&&savedIndex<state.stepCount){startIndex=savedIndex}}state.currentIndex=startIndex;stepTitles.each(function(index){var item=$(this),content=stepContents.eq(index),modeData=content.data("mode"),mode=(modeData==null)?contentMode.html:getValidEnumValue(contentMode,(/^\s*$/.test(modeData)||isNaN(modeData))?modeData:parseInt(modeData,0)),contentUrl=(mode===contentMode.html||content.data("url")===undefined)?"":content.data("url"),contentLoaded=(mode!==contentMode.html&&content.data("loaded")==="1"),step=$.extend({},stepModel,{title:item.html(),content:(mode===contentMode.html)?content.html():"",contentUrl:contentUrl,contentMode:mode,contentLoaded:contentLoaded});addStepToCache(wizard,step)})}function cancel(wizard){wizard.triggerHandler("canceled")}function decreaseCurrentIndexBy(state,decreaseBy){return state.currentIndex-decreaseBy}function destroy(wizard,options){var eventNamespace=getEventNamespace(wizard);wizard.unbind(eventNamespace).removeData("uid").removeData("options").removeData("state").removeData("steps").removeData("eventNamespace").find(".actions a").unbind(eventNamespace);wizard.removeClass(options.clearFixCssClass+" vertical");var contents=wizard.find(".content > *");contents.removeData("loaded").removeData("mode").removeData("url");contents.removeAttr("id").removeAttr("role").removeAttr("tabindex").removeAttr("class").removeAttr("style")._removeAria("labelledby")._removeAria("hidden");wizard.find(".content > [data-mode='async'],.content > [data-mode='iframe']").empty();var wizardSubstitute=$('<{0} class="{1}"></{0}>'.format(wizard.get(0).tagName,wizard.attr("class")));var wizardId=wizard._id();if(wizardId!=null&&wizardId!==""){wizardSubstitute._id(wizardId)}wizardSubstitute.html(wizard.find(".content").html());wizard.after(wizardSubstitute);wizard.remove();return wizardSubstitute}function finishStep(wizard,state){var currentStep=wizard.find(".steps li").eq(state.currentIndex);if(wizard.triggerHandler("finishing",[state.currentIndex])){currentStep.addClass("done").removeClass("error");wizard.triggerHandler("finished",[state.currentIndex])}else{currentStep.addClass("error")}}function getEventNamespace(wizard){var eventNamespace