mirror of
https://gitee.com/dotnetchina/OpenAuth.Net.git
synced 2026-03-25 18:53:25 +08:00
flow ui
This commit is contained in:
57
OpenAuth.Mvc/Content/scripts/plugins/wizard/wizard.css
Normal file
57
OpenAuth.Mvc/Content/scripts/plugins/wizard/wizard.css
Normal file
@@ -0,0 +1,57 @@
|
||||
.wizard{-moz-user-select: none;-webkit-user-select: none;-ms-user-select: none;-khtml-user-select: none;user-select: none;
|
||||
border: 1px solid #ccc;
|
||||
border-radius: 0px;background-clip: padding-box;background-color: #fff;position: relative;overflow: hidden;}
|
||||
.wizard.wizard-tabbed{background: #fbfbfb;}
|
||||
.wizard.wizard-tabbed ul li{padding: 0 30px;background-color: #fbfbfb;}
|
||||
.wizard.wizard-tabbed ul li .chevron{display: none;}
|
||||
.wizard.wizard-tabbed ul li .chevron:before{display: none;}
|
||||
.wizard.wizard-tabbed ul li.complete{background-color: #fbfbfb;}
|
||||
.wizard.wizard-tabbed ul li.active{background: #fff;}
|
||||
.wizard.wizard-wired{padding-top: 10px;display: block;background: #fff;text-align: center;-webkit-box-shadow: none;-moz-box-shadow: none;box-shadow: none;border-bottom: 1px solid #eee;}
|
||||
.wizard.wizard-wired ul{display: table;width: 100%;position: relative;}
|
||||
.wizard.wizard-wired ul li{display: table-cell;text-align: center;background-color: #fff;width: 20%;padding: 0;margin: 0;-webkit-transition: all 1s ease;-moz-transition: all 1s ease;-o-transition: all 1s ease;transition: all 1s ease;}
|
||||
.wizard.wizard-wired ul li .chevron{display: none;}
|
||||
.wizard.wizard-wired ul li .chevron:before{display: none;}
|
||||
.wizard.wizard-wired ul li.complete{background-color: #fff;}
|
||||
.wizard.wizard-wired ul li.complete .step:before{font-size: 22px;line-height: 36px;}
|
||||
.wizard.wizard-wired ul li.complete:hover{background-color: #fff;}
|
||||
.wizard.wizard-wired ul li.active{background-color: #fff;}
|
||||
.wizard.wizard-wired ul li .step{border-width: 2px;width: 40px;height: 40px;line-height: 34px;font-size: 15px;z-index: 2;background-color: #fff;}
|
||||
.wizard.wizard-wired ul li .title{display: block;margin-top: 4px;margin-bottom: 6px;max-width: 100%;font-size: 14px;line-height: 20px;z-index: 104;text-align: center;table-layout: fixed;-ms-word-wrap: break-word;word-wrap: break-word;}
|
||||
.wizard.wizard-wired ul li:before{display: block;content: "";width: 100%;height: 2px!important;font-size: 0;overflow: hidden;background-color: #e5e5e5;position: relative!important;top: 25px;z-index: 1!important;}
|
||||
.wizard.wizard-wired ul li:first-child:before{max-width: 51%;left: 50%;}
|
||||
.wizard.wizard-wired ul li:last-child:before{max-width: 50%;width: 50%;}
|
||||
.wizard ul{list-style: none outside none;padding: 0;margin: 0;width: 4000px;}
|
||||
.wizard ul.previous-disabled li.complete{cursor: default;}
|
||||
.wizard ul.previous-disabled li.complete:hover{background: #f3f3f3;cursor: default;}
|
||||
.wizard ul.previous-disabled li.complete:hover .chevron:before{border-left-color: #f3f3f3;}
|
||||
.wizard ul li{float: left;margin: 0;padding: 0 20px 0 30px;line-height: 46px;position: relative;background: #f5f5f5;color: #d0d0d0;font-size: 16px;cursor: default;-webkit-transition: all .218s ease;-moz-transition: all .218s ease;-o-transition: all .218s ease;transition: all .218s ease;}
|
||||
.wizard ul li .step{border: 2px solid #e5e5e5;color: #ccc;font-size: 13px;border-radius: 100%;position: relative;z-index: 2;display: inline-block;width: 24px;height: 24px;line-height: 20px;text-align: center;margin-right: 10px;}
|
||||
.wizard ul li .chevron{border: 24px solid transparent;border-left: 14px solid #d4d4d4;border-right: 0;display: block;position: absolute;right: -14px;top: 0;z-index: 1;}
|
||||
.wizard ul li .chevron:before{border: 24px solid transparent;border-left: 14px solid #f5f5f5;border-right: 0;content: "";display: block;position: absolute;right: 1px;top: -24px;-webkit-transition: all .218s ease;-moz-transition: all .218s ease;-o-transition: all .218s ease;transition: all .218s ease;}
|
||||
.wizard ul li.complete{background: #f5f5f5;color: #444;}
|
||||
.wizard ul li.complete:before{display: block;content: "";position: absolute;bottom: 0;left: 0;right: -1px;height: 2px;max-height: 2px;overflow: hidden;background-color: #449d44;z-index: 10000;}
|
||||
.wizard ul li.complete:hover{background: #eee;cursor: pointer;}
|
||||
.wizard ul li.complete:hover .chevron:before{border-left: 14px solid #eee;}
|
||||
.wizard ul li.complete .chevron:before{border-left: 14px solid #f5f5f5;}
|
||||
.wizard ul li.complete .step{color: #449d44;border-color: #449d44;}
|
||||
.wizard ul li.complete .step:before{display: block;position: absolute;top: 0;left: 0;bottom: 0;right: 0;line-height: 20px;text-align: center;border-radius: 100%;content: "";background-color: #fff;z-index: 3;font-family: FontAwesome;font-size: 12px;color: #449d44;}
|
||||
.wizard ul li.active{background: #fff;color: #262626;}
|
||||
.wizard ul li.active .step{border-color: #337ab7;color: #337ab7;}
|
||||
.wizard ul li.active:before{display: block;content: "";position: absolute;bottom: 0;left: 0;right: -1px;height: 2px;max-height: 2px;overflow: hidden;background-color: #337ab7;z-index: 10000;}
|
||||
.wizard ul li.active .chevron:before{border-left: 14px solid #fff;}
|
||||
.wizard ul li .badge{margin-right: 8px;}
|
||||
.wizard ul li:first-child{-webkit-border-radius: 2px 0 0 0;-webkit-background-clip: padding-box;-moz-border-radius: 2px 0 0 0;-moz-background-clip: padding;border-radius: 2px 0 0 0;background-clip: padding-box;padding-left: 20px;}
|
||||
.actions{z-index: 1000;position: absolute;right: 0;line-height: 42px;float: right;padding-left: 8px;padding-right: 8px;padding-bottom: 4px;vertical-align: middle;border-left: 1px solid #d4d4d4;}
|
||||
.actions a{line-height: 45px;font-size: 12px;margin-right: 8px;}
|
||||
.actions .btn-prev i{margin-right: 5px;}
|
||||
.actions .btn-next i{margin-left: 5px;}
|
||||
.actions.actions-footer{margin-top: -10px;position: relative;float: none;text-align: right;border: 0;background-color: #fff;-webkit-box-shadow: 0 0 4px rgba(0,0,0,.3);-moz-box-shadow: 0 0 4px rgba(0,0,0,.3);box-shadow: 0 0 4px rgba(0,0,0,.3);}
|
||||
.step-content{border-top: 0;background-clip: padding-box;padding: 0px;border: 1px solid #ccc;border-top:none;}
|
||||
.step-content .step-pane{display: none;}
|
||||
.step-content .active{display: block;}
|
||||
.step-content .active .btn-group .active{display: inline-block;}
|
||||
.chart{height: 220px;margin: 5px;}
|
||||
.chart-sm{height: 100px;}
|
||||
.chart-lg{height: 250px;}
|
||||
.chart-xl{height: 350px;}
|
||||
134
OpenAuth.Mvc/Content/scripts/plugins/wizard/wizard.js
Normal file
134
OpenAuth.Mvc/Content/scripts/plugins/wizard/wizard.js
Normal file
@@ -0,0 +1,134 @@
|
||||
(function (b, c) {
|
||||
var a = function (f, e) {
|
||||
var d;
|
||||
this.$element = b(f);
|
||||
this.options = b.extend({}, b.fn.wizard.defaults, e);
|
||||
this.currentStep = 1;
|
||||
this.numSteps = this.$element.find("li").length;
|
||||
/*Customized to Enable Out Of Wizard Buttons*/
|
||||
this.$prevBtn = $('#'+this.$element[0].id+'-actions').find("a.btn-prev");
|
||||
this.$nextBtn = $('#' + this.$element[0].id + '-actions').find("a.btn-next");
|
||||
/*End Customized to Enable Out Of Wizard Buttons*/
|
||||
d = this.$nextBtn.children().detach();
|
||||
this.nextText = b.trim(this.$nextBtn.text());
|
||||
this.$nextBtn.append(d);
|
||||
this.$prevBtn.on("click", b.proxy(this.previous, this));
|
||||
this.$nextBtn.on("click", b.proxy(this.next, this));
|
||||
this.$element.on("click", "li.complete", b.proxy(this.stepclicked, this));
|
||||
this.$stepContainer = this.$element.data("target") || "body";
|
||||
this.$stepContainer = b(this.$stepContainer)
|
||||
};
|
||||
a.prototype = {
|
||||
constructor: a,
|
||||
setState: function () {
|
||||
var n = (this.currentStep > 1);
|
||||
var o = (this.currentStep === 1);
|
||||
var d = (this.currentStep === this.numSteps);
|
||||
this.$prevBtn.attr("disabled", (o === true || n === false));
|
||||
var h = this.$nextBtn.data();
|
||||
if (h && h.last) {
|
||||
this.lastText = h.last;
|
||||
if (typeof this.lastText !== "undefined") {
|
||||
var l = (d !== true) ? this.nextText : this.lastText;
|
||||
var f = this.$nextBtn.children().detach();
|
||||
this.$nextBtn.text(l).append(f)
|
||||
}
|
||||
}
|
||||
var j = this.$element.find("li");
|
||||
j.removeClass("active").removeClass("complete");
|
||||
var m = "li:lt(" + (this.currentStep - 1) + ")";
|
||||
var g = this.$element.find(m);
|
||||
g.addClass("complete");
|
||||
var e = "li:eq(" + (this.currentStep - 1) + ")";
|
||||
var k = this.$element.find(e);
|
||||
k.addClass("active");
|
||||
var i = k.data().target;
|
||||
this.$stepContainer.find(".step-pane").removeClass("active");
|
||||
b(i).addClass("active");
|
||||
this.$element.trigger("changed")
|
||||
},
|
||||
stepclicked: function (h) {
|
||||
var d = b(h.currentTarget);
|
||||
var g = this.$element.find("li").index(d);
|
||||
var f = b.Event("change");
|
||||
this.$element.trigger(f, {
|
||||
step: g + 1,
|
||||
direction: "stepclicked",
|
||||
currentStep: g + 1
|
||||
});
|
||||
if (f.isDefaultPrevented()) {
|
||||
return
|
||||
}
|
||||
this.currentStep = (g + 1);
|
||||
this.setState()
|
||||
},
|
||||
previous: function () {
|
||||
var d = (this.currentStep > 1);
|
||||
if (d) {
|
||||
var f = b.Event("change");
|
||||
this.$element.trigger(f, {
|
||||
step: this.currentStep,
|
||||
direction: "previous",
|
||||
currentStep:this.currentStep-1
|
||||
});
|
||||
if (f.isDefaultPrevented()) {
|
||||
return
|
||||
}
|
||||
this.currentStep -= 1;
|
||||
this.setState()
|
||||
}
|
||||
},
|
||||
next: function () {
|
||||
var g = (this.currentStep + 1 <= this.numSteps);
|
||||
var d = (this.currentStep === this.numSteps);
|
||||
if (g) {
|
||||
var f = b.Event("change");
|
||||
this.$element.trigger(f, {
|
||||
step: this.currentStep,
|
||||
direction: "next",
|
||||
currentStep: this.currentStep + 1
|
||||
});
|
||||
if (f.isDefaultPrevented()) {
|
||||
return
|
||||
}
|
||||
this.currentStep += 1;
|
||||
this.setState()
|
||||
} else {
|
||||
if (d) {
|
||||
this.$element.trigger("finished")
|
||||
}
|
||||
}
|
||||
},
|
||||
selectedItem: function (d) {
|
||||
return {
|
||||
step: this.currentStep
|
||||
}
|
||||
}
|
||||
};
|
||||
b.fn.wizard = function (e, g) {
|
||||
var f;
|
||||
var d = this.each(function () {
|
||||
var j = b(this);
|
||||
var i = j.data("wizard");
|
||||
var h = typeof e === "object" && e;
|
||||
if (!i) {
|
||||
j.data("wizard", (i = new a(this, h)))
|
||||
}
|
||||
if (typeof e === "string") {
|
||||
f = i[e](g)
|
||||
}
|
||||
});
|
||||
return (f === c) ? d : f
|
||||
};
|
||||
b.fn.wizard.defaults = {};
|
||||
b.fn.wizard.Constructor = a;
|
||||
b(function () {
|
||||
b("body").on("mousedown.wizard.data-api", ".wizard", function () {
|
||||
var d = b(this);
|
||||
if (d.data("wizard")) {
|
||||
return
|
||||
}
|
||||
d.wizard(d.data())
|
||||
})
|
||||
})
|
||||
})(window.jQuery);
|
||||
Reference in New Issue
Block a user