(function(e, t, n, r) { function o(t, n) { this.element = t; this.$elem = e(this.element); this.options = e.extend({}, s, n); this._defaults = s; this._name = i; this.init() } var i = "progression", s = { tooltipWidth : "200", tooltipPosition : "right", tooltipOffset : "50", showProgressBar : true, showHelper : true, validator : false, tooltipFontSize : "14", tooltipFontColor : "ffffff", progressBarBackground : "ffffff", progressBarColor : "6EA5E1", tooltipBackgroundColor : "a2cbfa", tooltipPadding : "10", tooltipAnimate : true }; o.prototype = { init : function() { function t(e, t) { return t / e * 100 } data_prog = this.$elem.css("position", "relative").find( "[data-progression]"); items = data_prog.length; thisid = this.$elem.attr("id"); firstoffset = data_prog.first().position().top; firsthelper = data_prog.first().attr("data-helper"); if (data_prog.first().attr("data-helper") !== r) { firsthelper = data_prog.first().attr("data-helper") } else { firsthelper = "" } if (this.options.showProgressBar === false) { $display = "display:none;" } else { $display = "" } if (this.options.showHelper === false) { $display2 = "display:none;" } else { $display2 = "" } var n = this.options.tooltipAnimate ? "-webkit-transition: top .3s ease-in-out;-moz-transition: top .3s ease-in-out;-o-transition: top .3s ease-in-out;transition: top .3s ease-in-out;" : ""; var i = this.options.tooltipAnimate ? "-webkit-transition: width .3s ease-in-out;-moz-transition: width .3s ease-in-out;-o-transition: width .3s ease-in-out;transition: width .3s ease-in-out;" : ""; var s = this.options.tooltipPosition == "right" ? "border-color: transparent #" + this.options.tooltipBackgroundColor + " transparent transparent;" : "border-color: transparent transparent transparent #" + this.options.tooltipBackgroundColor + ""; marginRight = parseInt(this.options.tooltipWidth) + parseInt(this.options.tooltipOffset); myhtml = e('

1/' + items + " " + firsthelper + '

0%
"); this.$elem.prepend(myhtml); thiswidth = this.$elem.find(".syco_tooltip").width(); data_prog .each(function() { var n = e(this); var i = n.position().top; n .bind( "live focus change", function() { thisprogressionlength = n.parent() .parent() .find("[data-progression]").length; alldataprogression = n.parent() .parent() .find("[data-progression]"); thisid2 = n.parent().parent().attr( "id"); thistooltip = e('[data-tooltip="' + thisid2 + '"]'); thishelper = n.attr("data-helper"); if (n.attr("data-helper") !== r) { thishelper = n .attr("data-helper") } else { thishelper = "" } index = parseInt(e("#" + thisid2) .find("[data-progression]") .index(n)) + 1; if (this.value != "" && this .getAttribute("is_mandatory") == "true") { percentage = t( thisprogressionlength, index).toFixed(0); } else { percentage = 0; } thistooltip .find("p") .html( '' + index + "/" + thisprogressionlength + " " + thishelper) .parent() .find(".percentagebarinner") .css( "width", parseInt(percentage) + "%") .next() .html( parseInt(percentage) + "%"); thistooltip.css("top", i + "px") }) }) }, yourOtherFunction : function(e, t) { } }; e.fn[i] = function(t) { return this.each(function() { if (!e.data(this, "plugin_" + i)) { e.data(this, "plugin_" + i, new o(this, t)) } }) } })(jQuery, window, document)