ÿØÿà JFIF ` ` ÿþ
|
Server : Apache/2 System : Linux srv244.medyabim.com 4.18.0-553.89.1.el8_10.x86_64 #1 SMP Mon Dec 8 03:53:08 EST 2025 x86_64 User : lionbursa ( 1773) PHP Version : 5.6.40 Disable Function : exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname Directory : /home/lionbursa/public_html/admin/style/js/ |
Upload File : |
/*
* Copyright (C) 2013 Panopta, Andrew Moffat
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/(function(e){e.fn.wizard=function(e){return new Wizard(this,e)},e.fn.wizard.logging=!1;var t=function(e,t,n,r,i){this.wizard=e,this.index=n,this.prev=r,this.next=i,this.el=t,this.title=t.find("h3").first().text(),this.name=t.data("cardname")||this.title,this.nav=this._createNavElement(this.title,n),this._disabled=!1,this._loaded=!1,this._events={}};t.prototype={select:function(){this.log("selecting"),this.isSelected()||(this.nav.addClass("active"),this.el.show(),this._loaded||(this.trigger("loaded"),this.reload()),this.trigger("selected"));var e=this.wizard;return e.backButton.toggleClass("disabled",this.index==0),this.index>=e._cards.length-1?(this.log("on last card, changing next button to submit"),e.changeNextButton(e.args.buttons.submitText,"btn-success"),e._readyToSubmit=!0,e.trigger("readySubmit")):(e._readyToSubmit=!1,e.changeNextButton(e.args.buttons.nextText,"btn-primary")),this},_createNavElement:function(t,n){var r=e('<li class="wizard-nav-item"></li>'),i=e('<a class="wizard-nav-link"></a>');return i.data("navindex",n),r.append(i),i.append('<i class="icon-chevron-right"></i>'),i.append(t),r},markVisited:function(){return this.log("marking as visited"),this.nav.addClass("already-visited"),this.trigger("markVisited"),this},unmarkVisited:function(){return this.log("unmarking as visited"),this.nav.removeClass("already-visited"),this.trigger("unmarkVisited"),this},deselect:function(){return this.nav.removeClass("active"),this.el.hide(),this.trigger("deselect"),this},enable:function(){return this.log("enabling"),this.nav.addClass("active"),this._disabled=!1,this.trigger("enabled"),this},disable:function(e){return this.log("disabling"),this._disabled=!0,this.nav.removeClass("active already-visited"),e&&this.el.hide(),this.trigger("disabled"),this},isDisabled:function(){return this._disabled},alreadyVisited:function(){return this.nav.hasClass("already-visited")},isSelected:function(){return this.nav.hasClass("active")},reload:function(){return this._loaded=!0,this.trigger("reload"),this},on:function(){return this.wizard.on.apply(this,arguments)},trigger:function(){return this.callListener("on"+arguments[0]),this.wizard.trigger.apply(this,arguments)},toggleAlert:function(t,n){this.log("toggling alert to: "+n),n=typeof n=="undefined"?!0:n,n?this.trigger("showAlert"):this.trigger("hideAlert");var r,i=this.el.children("h3").first().next("div.alert");if(i.length==0){if(!n)return this;this.log("couldn't find existing alert div, creating one"),r=e("<div />"),r.addClass("alert"),r.addClass("hide"),r.insertAfter(this.el.find("h3").first())}else this.log("found existing alert div"),r=i.first();return n?(t!=null&&(this.log("setting alert msg to",t),r.html(t)),r.show()):r.hide(),this},callListener:function(e){e=e.toLowerCase(),this.log("looking for listener "+e);var t=window[this.el.data(e)];if(t){this.log("calling listener "+e);var n=this.wizard;try{var r=t(this)}catch(i){this.log("exception calling listener "+e+": ",i)}}else this.log("didn't find listener "+e)},problem:function(e){this.nav.find("a").toggleClass("wizard-step-error",e)},validate:function(){var t=!1,n=this;this.el.find("[data-validate]").each(function(r,i){n.log("validating individiual inputs"),i=e(i);var s=i.data("validate");if(!s)return;var o={status:!0,title:"Error",msg:""},u=window[s](i);e.extend(o,u);if(!o.status)t=!0,i.parent(".control-group").toggleClass("error",!0),n.wizard.errorPopover(i,o.msg);else{i.parent(".control-group").toggleClass("error",!1);try{i.popover("destroy")}catch(a){i.popover("hide")}}}),this.log("after validating inputs, failures is",t);var r=window[this.el.data("validate")];if(r){this.log("running html-embedded card validator");var i=r(this);if(typeof i=="undefined"||i==null)i=!0;i||(t=!0),this.log("after running html-embedded card validator, failures is",t)}this.log("running listener validator");var s=this.trigger("validate");if(typeof s=="undefined"||s==null)s=!0;s||(t=!0),this.log("after running listener validator, failures is",t);var o=!t;return o?(this.log("validated, calling listeners"),this.trigger("validated")):(this.log("invalid"),this.trigger("invalid")),o},log:function(){if(!window.console||!e.fn.wizard.logging)return;var t="card '"+this.name+"': ",n=[t];n.push.apply(n,arguments),console.log.apply(console,n)},isActive:function(){return this.nav.hasClass("active")}},Wizard=function(t,n){var r=['<div class="modal hide wizard-modal" role="dialog">','<div class="wizard-modal-header modal-header">','<button class="wizard-close close" type="button">x</button>','<h3 class="wizard-title"></h3>','<span class="wizard-subtitle"></span>',"</div>",'<div class="pull-left wizard-steps">','<div class="wizard-nav-container">','<ul class="nav nav-list" style="padding-bottom:30px;">',"</ul>","</div>",'<div class="wizard-progress-container">',,'<div class="progress progress-striped">','<div class="bar"></div>',"</div>","</div>","</div>","<form>",'<div class="wizard-cards">','<div class="wizard-card-container">',"</div>",'<div class="wizard-modal-footer">','<div class="wizard-buttons-container">','<button class="btn wizard-cancel wizard-close" type="button">Cancel</button>','<div class="btn-group-single pull-right">','<button class="btn wizard-back" type="button">Back</button>','<button class="btn btn-primary wizard-next" type="button">Next</button>',"</div>","</div>","</div>","</div>","</form>","</div>"];this.args={submitUrl:"",width:750,showCancel:!1,progressBarCurrent:!1,increaseHeight:0,buttons:{cancelText:"Cancel",nextText:"Next",backText:"Back",submitText:"Submit",submittingText:"Submitting..."}},e.extend(this.args,n||{}),this.markup=e(t),this.submitCards=this.markup.find(".wizard-error,.wizard-failure,.wizard-success,.wizard-loading"),this.el=e(r.join("\n")),this.el.find(".wizard-card-container").append(this.markup.find(".wizard-card")).append(this.submitCards),e("body").append(this.el),this.closeButton=this.el.find("button.wizard-close"),this.footer=this.el.find(".wizard-modal-footer"),this.cancelButton=this.footer.find(".wizard-cancel"),this.backButton=this.footer.find(".wizard-back"),this.nextButton=this.footer.find(".wizard-next"),this.progress=this.el.find(".progress"),this._cards=[],this.cards={},this._readyToSubmit=!1,this.percentComplete=0,this._submitting=!1,this._events={},this._firstShow=!0,this._createCards(),this.nextButton.click(this,this._handleNextClick),this.backButton.click(this,this._handleBackClick),this.cancelButton.text(this.args.buttons.cancelText),this.backButton.text(this.args.buttons.backText),this.nextButton.text(this.args.buttons.nextText);var i=360,s=i+this.args.increaseHeight;this.el.find(".wizard-nav-container").css("height",s),this.el.find(".wizard-steps").css("height",s+65+"px"),this.el.find(".wizard-card").css("height",s-60+"px"),this.submitCards.css("height",s-60+"px"),this.el.css("margin-top",-(this.el.height()/2)),this.el.css("width",this.args.width),this.el.css("margin-left",-(this.args.width/2));if(e.fn.slimScroll&&!1){var o={position:"left",height:"360px",size:"8px",distance:"5px",railVisible:!0,disableFadeOut:!0};e.extend(o,this.args.slimScroll||{}),this.el.find(".wizard-nav-container").slimScroll(o)}var u=this;this.closeButton.click(function(){u.reset(),u.close(),u.trigger("closed")}),this.el.find(".wizard-steps").on("click","li.already-visited a.wizard-nav-link",this,function(t){var n=parseInt(e(t.target).data("navindex"));t.data.setCard(n)});var a=this.markup.children("h1").first();a.length&&this.setTitle(a.text()),this.on("submit",this._defaultSubmit)},Wizard.prototype={errorPopover:function(e,t){this.log("launching popover on",e);var n=e.popover({content:t,trigger:"manual"}).popover("show").next(".popover");return n.addClass("error-popover"),n},destroyPopover:function(t){t=e(t),t.parent(".control-group").toggleClass("error",!1);var n=t.prev();try{n.popover("destroy")}catch(r){n.popover("hide")}},hidePopovers:function(e){this.log("hiding all popovers");var t=this;this.el.find(".error-popover").each(function(e,n){t.destroyPopover(n)})},eachCard:function(t){return e.each(this._cards,t),this},getActiveCard:function(){this.log("getting active card");var t=null;return e.each(this._cards,function(e,n){if(n.isActive())return t=n,!1}),t?this.log("found active card",t):this.log("couldn't find an active card"),t},setTitle:function(e){return this.log("setting title to",e),this.el.find(".wizard-title").first().text(e),this},setSubtitle:function(e){return this.log("setting subtitle to",e),this.el.find(".wizard-subtitle").first().text(e),this},changeNextButton:function(e,t){return this.log("changing next button, text: "+e,"class: "+t),typeof t!="undefined"&&this.nextButton.removeClass("btn-success btn-primary"),t&&this.nextButton.addClass(t),this.nextButton.text(e),this},hide:function(){return this.log("hiding"),this.el.modal("hide"),this},close:function(){return this.log("closing"),this.el.modal("hide"),this},show:function(e){return this.log("showing"),this._firstShow&&(this.setCard(0),this._firstShow=!1),this.args.showCancel&&this.cancelButton.show(),this.el.modal(e),this},on:function(e,t){return this.log("adding listener to event "+e),this._events[e]=t,this},trigger:function(){var e=arguments[0],t=Array.prototype.slice.call(arguments);t.shift(),t.unshift(this),this.log("firing event "+e);var n=this._events[e],r=null;if(typeof n=="function"){this.log("found event handler, calling "+e);try{r=n.apply(this,t)}catch(i){this.log("event handler "+e+" had an exception")}}else this.log("couldn't find an event handler for "+e);return r},reset:function(){return this.log("resetting"),this.updateProgressBar(0),this.hideSubmitCards(),this.setCard(0),this.lockCards(),this.enableNextButton(),this.showButtons(),this.hidePopovers(),this.trigger("reset"),this},log:function(){if(!window.console||!e.fn.wizard.logging)return;var t="wizard "+this.el.id+": ",n=[t];n.push.apply(n,arguments),console.log.apply(console,n)},_abstractIncrementStep:function(e,t){var n=this.getActiveCard(),r;if(n){this.log("searching for valid next card");for(;;){r=t(n);if(r){this.log("looking at card",r.index);if(r.isDisabled()){this.log("card "+r.index+" is disabled/locked, continuing"),n=r;continue}return this.setCard(n.index+e)}this.log("next card is not defined, breaking");break}}else this.log("current card is undefined")},incrementCard:function(){this.log("incrementing card");var e=this._abstractIncrementStep(1,function(e){return e.next});return this.trigger("incrementCard"),e},decrementCard:function(){this.log("decrementing card");var e=this._abstractIncrementStep(-1,function(e){return e.prev});return this.trigger("decrementCard"),e},setCard:function(e){this.log("setting card to "+e),this.hideSubmitCards();var t=this.getActiveCard();if(this._submitting)return this.log("we're submitting the wizard already, can't change cards"),t;var n=this._cards[e];if(n){if(n.isDisabled())return this.log("new card is currently disabled, returning"),t;if(t){if(e>t.index){var r=t,i=!1;while(r.index!=n.index){r.index!=t.index&&(r.prev.deselect(),r.prev.markVisited(),r.select()),i=r.validate();if(!i)return r;r=r.next}r.prev.deselect(),r.prev.markVisited()}t.deselect(),t.markVisited()}n.select();if(this.args.progressBarCurrent)this.percentComplete=e*100/this._cards.length,this.updateProgressBar(this.percentComplete);else{var s=this.percentComplete;this.percentComplete=e*100/this._cards.length,this.percentComplete=Math.max(s,this.percentComplete),this.updateProgressBar(this.percentComplete)}return n}this.log("couldn't find card "+e)},updateProgressBar:function(e){this.log("updating progress to "+e+"%"),this.progress.find(".bar").css({width:e+"%"}),this.percentComplete=e,this.trigger("progressBar",e),e==100?(this.log("progress is 100, animating progress bar"),this.progress.addClass("active")):e==0&&(this.log("progress is 0, disabling animation"),this.progress.removeClass("active"))},getNextCard:function(){var e=this.getActiveCard();if(e)return e.next},lockCards:function(){return this.log("locking nav cards"),this.eachCard(function(e,t){t.unmarkVisited()}),this},disableCards:function(){return this.log("disabling all nav cards"),this.eachCard(function(e,t){t.disable()}),this},enableCards:function(){return this.log("enabling all nav cards"),this.eachCard(function(e,t){t.enable()}),this},hideCards:function(){return this.log("hiding cards"),this.eachCard(function(e,t){t.deselect()}),this.hideSubmitCards(),this},hideButtons:function(){return this.log("hiding buttons"),this.cancelButton.hide(),this.nextButton.hide(),this.backButton.hide(),this},showButtons:function(){return this.log("showing buttons"),this.args.showCancel&&this.cancelButton.show(),this.nextButton.show(),this.backButton.show(),this},getCard:function(t){var n=e(t).parents(".wizard-card").first()[0];if(n){var r=null;return this.eachCard(function(e,t){return n==t.el[0]?(r=t,!1):!0}),r}return null},_createCards:function(){var n=null,r=null,i=null,s=this,o=this,u=this.el.find(".wizard-cards .wizard-card");e.each(u,function(u,a){a=e(a),n=i,i=new t(s,a,u,n,r),o._cards.push(i),i.name&&(o.cards[i.name]=i),n&&(n.next=i),o.el.find(".wizard-steps .nav-list").append(i.nav)})},showSubmitCard:function(e){this.log("showing "+e+" submit card");var t=this.el.find(".wizard-"+e);t.length?(this.hideCards(),this.el.find(".wizard-"+e).show()):this.log("couldn't find submit card "+e)},hideSubmitCard:function(e){this.log("hiding "+e+" submit card"),this.el.find(".wizard-"+e).hide()},hideSubmitCards:function(){var t=this;e.each(["success","error","failure","loading"],function(e,n){t.hideSubmitCard(n)})},enableNextButton:function(){return this.log("enabling next button"),this.nextButton.removeAttr("disabled"),this},disableNextButton:function(){return this.log("disabling next button"),this.nextButton.attr("disabled","disabled"),this},serializeArray:function(){var e=this.el.children("form").first();return e.serializeArray()},serialize:function(){var e=this.el.children("form").first();return e.serialize()},submitSuccess:function(){this.log("submit success"),this._submitting=!1,this.showSubmitCard("success"),this.trigger("submitSuccess")},submitFailure:function(){this.log("submit failure"),this._submitting=!1,this.showSubmitCard("failure"),this.trigger("submitFailure")},submitError:function(){this.log("submit error"),this._submitting=!1,this.showSubmitCard("error"),this.trigger("submitError")},_submit:function(){this.log("submitting wizard"),this._submitting=!0,this.lockCards(),this.cancelButton.hide(),this.backButton.hide(),this.showSubmitCard("loading"),this.updateProgressBar(100),this.changeNextButton(this.args.buttons.submittingText,!1),this.disableNextButton();var e=this.trigger("submit");this.trigger("loading")},_onNextClick:function(){this.log("handling 'next' button click");var e=this.getActiveCard();this._readyToSubmit&&e.validate()?this._submit():e=this.incrementCard()},_onBackClick:function(){this.log("handling 'back' button click");var e=this.decrementCard()},_handleNextClick:function(e){var t=e.data;t._onNextClick.call(t)},_handleBackClick:function(e){var t=e.data;t._onBackClick.call(t)},_defaultSubmit:function(t){e.ajax({type:"POST",url:t.args.submitUrl,data:t.serialize(),dataType:"json",success:function(e){t.submitSuccess(),t.hideButtons(),t.updateProgressBar(0)},error:function(){t.submitFailure(),t.hideButtons()}})}}})(window.jQuery);