definicao de layout
This commit is contained in:
216
public/assets/js/form-wizard/form-wizard-five.js
Normal file
216
public/assets/js/form-wizard/form-wizard-five.js
Normal file
@@ -0,0 +1,216 @@
|
||||
(function(a) {
|
||||
a.fn.smartWizard = function(m) {
|
||||
var c = a.extend({}, a.fn.smartWizard.defaults, m),
|
||||
x = arguments;
|
||||
return this.each(function() {
|
||||
function C() {
|
||||
var e = b.children("div");
|
||||
b.children("ul").addClass("anchor");
|
||||
e.addClass("content");
|
||||
n = a("<div>Loading</div>").addClass("loader");
|
||||
k = a("<div></div>").addClass("action-bar");
|
||||
p = a("<div></div>").addClass("step-container");
|
||||
q = a("<a>" + c.labelNext + "</a>").attr("href", "#").addClass("btn btn-primary");
|
||||
r = a("<a>" + c.labelPrevious + "</a>").attr("href", "#").addClass("btn btn-primary");
|
||||
s = a("<a>" + c.labelFinish + "</a>").attr("href", "#").addClass("btn btn-primary");
|
||||
c.errorSteps && 0 < c.errorSteps.length && a.each(c.errorSteps, function(a, b) {
|
||||
y(b, !0)
|
||||
});
|
||||
p.append(e);
|
||||
k.append(n);
|
||||
b.append(p);
|
||||
b.append(k);
|
||||
c.includeFinishButton && k.append(s);
|
||||
k.append(q).append(r);
|
||||
z = p.width();
|
||||
a(q).click(function() {
|
||||
if (a(this).hasClass("buttonDisabled")) return !1;
|
||||
A();
|
||||
return !1
|
||||
});
|
||||
a(r).click(function() {
|
||||
if (a(this).hasClass("buttonDisabled")) return !1;
|
||||
B();
|
||||
return !1
|
||||
});
|
||||
a(s).click(function() {
|
||||
if (!a(this).hasClass("buttonDisabled"))
|
||||
if (a.isFunction(c.onFinish)) c.onFinish.call(this,
|
||||
a(f));
|
||||
else {
|
||||
var d = b.parents("form");
|
||||
d && d.length && d.submit()
|
||||
}
|
||||
return !1
|
||||
});
|
||||
a(f).bind("click", function(a) {
|
||||
if (f.index(this) == h) return !1;
|
||||
a = f.index(this);
|
||||
1 == f.eq(a).attr("isDone") - 0 && t(a);
|
||||
return !1
|
||||
});
|
||||
c.keyNavigation && a(document).keyup(function(a) {
|
||||
39 == a.which ? A() : 37 == a.which && B()
|
||||
});
|
||||
D();
|
||||
t(h)
|
||||
}
|
||||
function D() {
|
||||
c.enableAllSteps ? (a(f, b).removeClass("selected").removeClass("disabled").addClass("done"), a(f, b).attr("isDone", 1)) : (a(f, b).removeClass("selected").removeClass("done").addClass("disabled"), a(f, b).attr("isDone",
|
||||
0));
|
||||
a(f, b).each(function(e) {
|
||||
a(a(this).attr("href"), b).hide();
|
||||
a(this).attr("rel", e + 1)
|
||||
})
|
||||
}
|
||||
function t(e) {
|
||||
var d = f.eq(e),
|
||||
g = c.contentURL,
|
||||
h = d.data("hasContent");
|
||||
stepNum = e + 1;
|
||||
g && 0 < g.length ? c.contentCache && h ? w(e) : a.ajax({
|
||||
url: g,
|
||||
type: "POST",
|
||||
data: {
|
||||
step_number: stepNum
|
||||
},
|
||||
dataType: "text",
|
||||
beforeSend: function() {
|
||||
n.show()
|
||||
},
|
||||
error: function() {
|
||||
n.hide()
|
||||
},
|
||||
success: function(c) {
|
||||
n.hide();
|
||||
c && 0 < c.length && (d.data("hasContent", !0), a(a(d, b).attr("href"), b).html(c), w(e))
|
||||
}
|
||||
}) : w(e)
|
||||
}
|
||||
function w(e) {
|
||||
var d = f.eq(e),
|
||||
g = f.eq(h);
|
||||
if (e != h && a.isFunction(c.onLeaveStep) &&
|
||||
!c.onLeaveStep.call(this, a(g))) return !1;
|
||||
c.updateHeight && p.height(a(a(d, b).attr("href"), b).outerHeight());
|
||||
if ("slide" == c.transitionEffect) a(a(g, b).attr("href"), b).slideUp("fast", function(c) {
|
||||
a(a(d, b).attr("href"), b).slideDown("fast");
|
||||
h = e;
|
||||
u(g, d)
|
||||
});
|
||||
else if ("fade" == c.transitionEffect) a(a(g, b).attr("href"), b).fadeOut("fast", function(c) {
|
||||
a(a(d, b).attr("href"), b).fadeIn("fast");
|
||||
h = e;
|
||||
u(g, d)
|
||||
});
|
||||
else if ("slideleft" == c.transitionEffect) {
|
||||
var k = 0;
|
||||
e > h ? (nextElmLeft1 = z + 10, nextElmLeft2 = 0, k = 0 - a(a(g, b).attr("href"), b).outerWidth()) :
|
||||
(nextElmLeft1 = 0 - a(a(d, b).attr("href"), b).outerWidth() + 20, nextElmLeft2 = 0, k = 10 + a(a(g, b).attr("href"), b).outerWidth());
|
||||
e == h ? (nextElmLeft1 = a(a(d, b).attr("href"), b).outerWidth() + 20, nextElmLeft2 = 0, k = 0 - a(a(g, b).attr("href"), b).outerWidth()) : a(a(g, b).attr("href"), b).animate({
|
||||
left: k
|
||||
}, "fast", function(e) {
|
||||
a(a(g, b).attr("href"), b).hide()
|
||||
});
|
||||
a(a(d, b).attr("href"), b).css("left", nextElmLeft1);
|
||||
a(a(d, b).attr("href"), b).show();
|
||||
a(a(d, b).attr("href"), b).animate({
|
||||
left: nextElmLeft2
|
||||
}, "fast", function(a) {
|
||||
h = e;
|
||||
u(g, d)
|
||||
})
|
||||
} else a(a(g,
|
||||
b).attr("href"), b).hide(), a(a(d, b).attr("href"), b).show(), h = e, u(g, d);
|
||||
return !0
|
||||
}
|
||||
function u(e, d) {
|
||||
a(e, b).removeClass("selected");
|
||||
a(e, b).addClass("done");
|
||||
a(d, b).removeClass("disabled");
|
||||
a(d, b).removeClass("done");
|
||||
a(d, b).addClass("selected");
|
||||
a(d, b).attr("isDone", 1);
|
||||
c.cycleSteps || (0 >= h ? a(r).addClass("buttonDisabled") : a(r).removeClass("buttonDisabled"), f.length - 1 <= h ? a(q).addClass("buttonDisabled") : a(q).removeClass("buttonDisabled"));
|
||||
!f.hasClass("disabled") || c.enableFinishButton ? a(s).removeClass("buttonDisabled") :
|
||||
a(s).addClass("buttonDisabled");
|
||||
if (a.isFunction(c.onShowStep) && !c.onShowStep.call(this, a(d))) return !1
|
||||
}
|
||||
function A() {
|
||||
var a = h + 1;
|
||||
if (f.length <= a) {
|
||||
if (!c.cycleSteps) return !1;
|
||||
a = 0
|
||||
}
|
||||
t(a)
|
||||
}
|
||||
function B() {
|
||||
var a = h - 1;
|
||||
if (0 > a) {
|
||||
if (!c.cycleSteps) return !1;
|
||||
a = f.length - 1
|
||||
}
|
||||
t(a)
|
||||
}
|
||||
function E(b) {
|
||||
a(".content", l).html(b);
|
||||
l.show()
|
||||
}
|
||||
function y(c, d) {
|
||||
d ? a(f.eq(c - 1), b).addClass("error") : a(f.eq(c - 1), b).removeClass("error")
|
||||
}
|
||||
var b = a(this),
|
||||
h = c.selected,
|
||||
f = a("ul > li > a[href^='#step-']", b),
|
||||
z = 0,
|
||||
n, l, k, p, q, r, s;
|
||||
k = a(".action-bar", b);
|
||||
0 == k.length && (k =
|
||||
a("<div></div>").addClass("action-bar"));
|
||||
l = a(".msg-box", b);
|
||||
0 == l.length && (l = a('<div class="msg-box"><div class="content"></div><a href="javascript:void(0)" class="close"><i class="icofont icofont-close-line-circled"></i></a></div>'), k.append(l));
|
||||
a(".close", l).click(function() {
|
||||
l.fadeOut("normal");
|
||||
return !1
|
||||
});
|
||||
if (m && "init" !== m && "object" !== typeof m) {
|
||||
if ("showMessage" === m) {
|
||||
var v = Array.prototype.slice.call(x, 1);
|
||||
E(v[0]);
|
||||
return !0
|
||||
}
|
||||
if ("setError" === m) return v = Array.prototype.slice.call(x, 1), y(v[0].stepnum, v[0].iserror), !0;
|
||||
a.error("Method " + m + " does not exist")
|
||||
} else C()
|
||||
})
|
||||
};
|
||||
a.fn.smartWizard.defaults = {
|
||||
selected: 0,
|
||||
keyNavigation: !0,
|
||||
enableAllSteps: !1,
|
||||
updateHeight: !0,
|
||||
transitionEffect: "fade",
|
||||
contentURL: null,
|
||||
contentCache: !0,
|
||||
cycleSteps: !1,
|
||||
includeFinishButton: !0,
|
||||
enableFinishButton: !1,
|
||||
errorSteps: [],
|
||||
labelNext: "Next",
|
||||
labelPrevious: "Previous",
|
||||
labelFinish: "Finish",
|
||||
onLeaveStep: null,
|
||||
onShowStep: null,
|
||||
onFinish: null
|
||||
}
|
||||
})(jQuery);
|
||||
(function($) {
|
||||
"use strict";
|
||||
$('#wizard').smartWizard({
|
||||
transitionEffect: 'slideleft',
|
||||
onFinish: onFinishCallback
|
||||
});
|
||||
function onFinishCallback() {
|
||||
$('#wizard').smartWizard('showMessage', 'All Step Done.. !!!');
|
||||
}
|
||||
})(jQuery);
|
||||
78
public/assets/js/form-wizard/form-wizard-three.js
Normal file
78
public/assets/js/form-wizard/form-wizard-three.js
Normal file
@@ -0,0 +1,78 @@
|
||||
"use strict";
|
||||
function scroll_to_class(element_class, removed_height) {
|
||||
var scroll_to = $(element_class).offset().top - removed_height;
|
||||
if($(window).scrollTop() != scroll_to) {
|
||||
$('html, body').stop().animate({scrollTop: scroll_to}, 0);
|
||||
}
|
||||
}
|
||||
function bar_progress(progress_line_object, direction) {
|
||||
var number_of_steps = progress_line_object.data('number-of-steps');
|
||||
var now_value = progress_line_object.data('now-value');
|
||||
var new_value = 0;
|
||||
if(direction == 'right') {
|
||||
new_value = now_value + ( 100 / number_of_steps );
|
||||
}
|
||||
else if(direction == 'left') {
|
||||
new_value = now_value - ( 100 / number_of_steps );
|
||||
}
|
||||
progress_line_object.attr('style', 'width: ' + new_value + '%;').data('now-value', new_value);
|
||||
}
|
||||
(function($) {
|
||||
"use strict";
|
||||
$.backstretch;
|
||||
$('#top-navbar-1').on('shown.bs.collapse', function(){
|
||||
$.backstretch("resize");
|
||||
});
|
||||
$('#top-navbar-1').on('hidden.bs.collapse', function(){
|
||||
$.backstretch("resize");
|
||||
});
|
||||
$('.f1 fieldset:first').fadeIn('slow');
|
||||
|
||||
$('.f1 input[type="text"], .f1 input[type="password"], .f1 textarea').on('focus', function() {
|
||||
$(this).removeClass('input-error');
|
||||
});
|
||||
$('.f1 .btn-next').on('click', function() {
|
||||
var parent_fieldset = $(this).parents('fieldset');
|
||||
var next_step = true;
|
||||
var current_active_step = $(this).parents('.f1').find('.f1-step.active');
|
||||
var progress_line = $(this).parents('.f1').find('.f1-progress-line');
|
||||
parent_fieldset.find('input[type="text"], input[type="password"], textarea').each(function() {
|
||||
if( $(this).val() == "" ) {
|
||||
$(this).addClass('input-error');
|
||||
next_step = false;
|
||||
}
|
||||
else {
|
||||
$(this).removeClass('input-error');
|
||||
}
|
||||
});
|
||||
if( next_step ) {
|
||||
parent_fieldset.fadeOut(400, function() {
|
||||
current_active_step.removeClass('active').addClass('activated').next().addClass('active');
|
||||
bar_progress(progress_line, 'right');
|
||||
$(this).next().fadeIn();
|
||||
scroll_to_class( $('.f1'), 20 );
|
||||
});
|
||||
}
|
||||
});
|
||||
$('.f1 .btn-previous').on('click', function() {
|
||||
var current_active_step = $(this).parents('.f1').find('.f1-step.active');
|
||||
var progress_line = $(this).parents('.f1').find('.f1-progress-line');
|
||||
$(this).parents('fieldset').fadeOut(400, function() {
|
||||
current_active_step.removeClass('active').prev().removeClass('activated').addClass('active');
|
||||
bar_progress(progress_line, 'left');
|
||||
$(this).prev().fadeIn();
|
||||
scroll_to_class( $('.f1'), 20 );
|
||||
});
|
||||
});
|
||||
$('.f1').on('submit', function(e) {
|
||||
$(this).find('input[type="text"], input[type="password"], textarea').each(function() {
|
||||
if( $(this).val() == "" ) {
|
||||
e.preventDefault();
|
||||
$(this).addClass('input-error');
|
||||
}
|
||||
else {
|
||||
$(this).removeClass('input-error');
|
||||
}
|
||||
});
|
||||
});
|
||||
})(jQuery);
|
||||
42
public/assets/js/form-wizard/form-wizard-two.js
Normal file
42
public/assets/js/form-wizard/form-wizard-two.js
Normal file
@@ -0,0 +1,42 @@
|
||||
(function($) {
|
||||
"use strict";
|
||||
var fomr_wizard_two = {
|
||||
init: function() {
|
||||
var navListItems = $('div.setup-panel div a'),
|
||||
allWells = $('.setup-content'),
|
||||
allNextBtn = $('.nextBtn');
|
||||
allWells.hide();
|
||||
navListItems.click(function (e) {
|
||||
e.preventDefault();
|
||||
var $target = $($(this).attr('href')),
|
||||
$item = $(this);
|
||||
if (!$item.hasClass('disabled')) {
|
||||
navListItems.removeClass('btn btn-light').addClass('btn btn-primary');
|
||||
$item.addClass('btn btn-light');
|
||||
allWells.hide();
|
||||
$target.show();
|
||||
$target.find('input:eq(0)').focus();
|
||||
}
|
||||
}), allNextBtn.click(function(){
|
||||
var curStep = $(this).closest(".setup-content"),
|
||||
curStepBtn = curStep.attr("id"),
|
||||
nextStepWizard = $('div.setup-panel div a[href="#' + curStepBtn + '"]').parent().next().children("a"),
|
||||
curInputs = curStep.find("input[type='text'],input[type='url']"),
|
||||
isValid = true;
|
||||
$(".form-group").removeClass("has-error");
|
||||
for(var i=0; i<curInputs.length; i++){
|
||||
if (!curInputs[i].validity.valid){
|
||||
isValid = false;
|
||||
$(curInputs[i]).closest(".form-group").addClass("has-error");
|
||||
}
|
||||
}
|
||||
if (isValid)
|
||||
nextStepWizard.removeAttr('disabled').trigger('click');
|
||||
}), $('div.setup-panel div a.btn-primary').trigger('click');
|
||||
}
|
||||
};
|
||||
(function($) {
|
||||
"use strict";
|
||||
fomr_wizard_two.init();
|
||||
})(jQuery);
|
||||
})(jQuery);
|
||||
51
public/assets/js/form-wizard/form-wizard.js
Normal file
51
public/assets/js/form-wizard/form-wizard.js
Normal file
@@ -0,0 +1,51 @@
|
||||
"use strict";
|
||||
var currentTab = 0;
|
||||
showTab(currentTab);
|
||||
function showTab(n) {
|
||||
var x = document.getElementsByClassName("tab");
|
||||
x[n].style.display = "block";
|
||||
if (n == 0) {
|
||||
document.getElementById("prevBtn").style.display = "none";
|
||||
} else {
|
||||
document.getElementById("prevBtn").style.display = "inline";
|
||||
}
|
||||
if (n == (x.length - 1)) {
|
||||
document.getElementById("nextBtn").innerHTML = "Submit";
|
||||
} else {
|
||||
document.getElementById("nextBtn").innerHTML = "Next";
|
||||
}
|
||||
fixStepIndicator(n)
|
||||
}
|
||||
function nextPrev(n) {
|
||||
var x = document.getElementsByClassName("tab");
|
||||
if (n == 1 && !validateForm()) return false;
|
||||
x[currentTab].style.display = "none";
|
||||
currentTab = currentTab + n;
|
||||
if (currentTab >= x.length) {
|
||||
document.getElementById("regForm").submit();
|
||||
return false;
|
||||
}
|
||||
showTab(currentTab);
|
||||
}
|
||||
function validateForm() {
|
||||
var x, y, i, valid = true;
|
||||
x = document.getElementsByClassName("tab");
|
||||
y = x[currentTab].getElementsByTagName("input");
|
||||
for (i = 0; i < y.length; i++) {
|
||||
if (y[i].value == "") {
|
||||
y[i].className += " invalid";
|
||||
valid = false;
|
||||
}
|
||||
}
|
||||
if (valid) {
|
||||
document.getElementsByClassName("step")[currentTab].className += " finish";
|
||||
}
|
||||
return valid;
|
||||
}
|
||||
function fixStepIndicator(n) {
|
||||
var i, x = document.getElementsByClassName("step");
|
||||
for (i = 0; i < x.length; i++) {
|
||||
x[i].className = x[i].className.replace(" active", "");
|
||||
}
|
||||
x[n].className += " active";
|
||||
}
|
||||
4
public/assets/js/form-wizard/jquery.backstretch.min.js
vendored
Normal file
4
public/assets/js/form-wizard/jquery.backstretch.min.js
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
/*! Backstretch - v2.0.4 - 2013-06-19
|
||||
* http://srobbin.com/jquery-plugins/backstretch/
|
||||
* Copyright (c) 2013 Scott Robbin; Licensed MIT */
|
||||
(function(a,d,p){a.fn.backstretch=function(c,b){(c===p||0===c.length)&&a.error("No images were supplied for Backstretch");0===a(d).scrollTop()&&d.scrollTo(0,0);return this.each(function(){var d=a(this),g=d.data("backstretch");if(g){if("string"==typeof c&&"function"==typeof g[c]){g[c](b);return}b=a.extend(g.options,b);g.destroy(!0)}g=new q(this,c,b);d.data("backstretch",g)})};a.backstretch=function(c,b){return a("body").backstretch(c,b).data("backstretch")};a.expr[":"].backstretch=function(c){return a(c).data("backstretch")!==p};a.fn.backstretch.defaults={centeredX:!0,centeredY:!0,duration:5E3,fade:0};var r={left:0,top:0,overflow:"hidden",margin:0,padding:0,height:"100%",width:"100%",zIndex:-999999},s={position:"absolute",display:"none",margin:0,padding:0,border:"none",width:"auto",height:"auto",maxHeight:"none",maxWidth:"none",zIndex:-999999},q=function(c,b,e){this.options=a.extend({},a.fn.backstretch.defaults,e||{});this.images=a.isArray(b)?b:[b];a.each(this.images,function(){a("<img />")[0].src=this});this.isBody=c===document.body;this.$container=a(c);this.$root=this.isBody?l?a(d):a(document):this.$container;c=this.$container.children(".backstretch").first();this.$wrap=c.length?c:a('<div class="backstretch"></div>').css(r).appendTo(this.$container);this.isBody||(c=this.$container.css("position"),b=this.$container.css("zIndex"),this.$container.css({position:"static"===c?"relative":c,zIndex:"auto"===b?0:b,background:"none"}),this.$wrap.css({zIndex:-999998}));this.$wrap.css({position:this.isBody&&l?"fixed":"absolute"});this.index=0;this.show(this.index);a(d).on("resize.backstretch",a.proxy(this.resize,this)).on("orientationchange.backstretch",a.proxy(function(){this.isBody&&0===d.pageYOffset&&(d.scrollTo(0,1),this.resize())},this))};q.prototype={resize:function(){try{var a={left:0,top:0},b=this.isBody?this.$root.width():this.$root.innerWidth(),e=b,g=this.isBody?d.innerHeight?d.innerHeight:this.$root.height():this.$root.innerHeight(),j=e/this.$img.data("ratio"),f;j>=g?(f=(j-g)/2,this.options.centeredY&&(a.top="-"+f+"px")):(j=g,e=j*this.$img.data("ratio"),f=(e-b)/2,this.options.centeredX&&(a.left="-"+f+"px"));this.$wrap.css({width:b,height:g}).find("img:not(.deleteable)").css({width:e,height:j}).css(a)}catch(h){}return this},show:function(c){if(!(Math.abs(c)>this.images.length-1)){var b=this,e=b.$wrap.find("img").addClass("deleteable"),d={relatedTarget:b.$container[0]};b.$container.trigger(a.Event("backstretch.before",d),[b,c]);this.index=c;clearInterval(b.interval);b.$img=a("<img />").css(s).bind("load",function(f){var h=this.width||a(f.target).width();f=this.height||a(f.target).height();a(this).data("ratio",h/f);a(this).fadeIn(b.options.speed||b.options.fade,function(){e.remove();b.paused||b.cycle();a(["after","show"]).each(function(){b.$container.trigger(a.Event("backstretch."+this,d),[b,c])})});b.resize()}).appendTo(b.$wrap);b.$img.attr("src",b.images[c]);return b}},next:function(){return this.show(this.index<this.images.length-1?this.index+1:0)},prev:function(){return this.show(0===this.index?this.images.length-1:this.index-1)},pause:function(){this.paused=!0;return this},resume:function(){this.paused=!1;this.next();return this},cycle:function(){1<this.images.length&&(clearInterval(this.interval),this.interval=setInterval(a.proxy(function(){this.paused||this.next()},this),this.options.duration));return this},destroy:function(c){a(d).off("resize.backstretch orientationchange.backstretch");clearInterval(this.interval);c||this.$wrap.remove();this.$container.removeData("backstretch")}};var l,f=navigator.userAgent,m=navigator.platform,e=f.match(/AppleWebKit\/([0-9]+)/),e=!!e&&e[1],h=f.match(/Fennec\/([0-9]+)/),h=!!h&&h[1],n=f.match(/Opera Mobi\/([0-9]+)/),t=!!n&&n[1],k=f.match(/MSIE ([0-9]+)/),k=!!k&&k[1];l=!((-1<m.indexOf("iPhone")||-1<m.indexOf("iPad")||-1<m.indexOf("iPod"))&&e&&534>e||d.operamini&&"[object OperaMini]"==={}.toString.call(d.operamini)||n&&7458>t||-1<f.indexOf("Android")&&e&&533>e||h&&6>h||"palmGetResource"in d&&e&&534>e||-1<f.indexOf("MeeGo")&&-1<f.indexOf("NokiaBrowser/8.5.0")||k&&6>=k)})(jQuery,window);
|
||||
Reference in New Issue
Block a user