parent
81bc933214
commit
4dba9770c9
5 changed files with 24 additions and 10 deletions
File diff suppressed because one or more lines are too long
@ -1 +1 @@ |
||||
var EXPO=EXPO||{};EXPO.registration=EXPO.registration||{},EXPO.registration.completion?console.warn("WARNING: EXPO.registration..completion is already defined!"):EXPO.registration.completion=function(){var e={},t=function(e){var t=$("#end-reg"),o="pwf-line",i=EXPO.common.opt.activeClass,r="phone",n="label",a=EXPO.common.opt.errMessageClass;if($("."+a,t).removeClass(i),e.success)location=e.redirect;else{console.log(e);for(var s in e.errors)e.errors.hasOwnProperty(s)&&($itemWrap=$("#id_"+s).closest("."+o),$("."+a,$itemWrap).addClass(i).text(e.errors[s][0]),$itemWrap.hasClass(r)&&$("."+n,$itemWrap).hide())}},o=function(e){$("#id_country").val("159").select2({placeholder:"Ваша страна",width:e}),$("#id_city").select2({placeholder:"Ваш город",width:e,ajax:{url:"/city/get-city/",dataType:"json",quietMillis:200,data:function(e,t,o){var o=$("#id_country").val();return{term:e,page:t,country:o}},results:function(e){var t=[];return $.each(e,function(e,o){t.push({id:o.id,text:o.label})}),{results:t}}},initSelection:function(e,t){var o=$(e).val(),i=$(e).attr("data-init-text");t({id:o,text:i})}})};e.opt={};EXPO.common;return $(function(){$("body").addClass("body-fixed"),o("100%"),$("#id_code_country").select2({width:"95px"}),$.fancybox.open([{href:"#end-reg"}],{closeBtn:!1,closeClick:!1,modal:!0,scrolling:"no",helpers:{overlay:{closeClick:!1},locked:!0},keys:{close:null}}),$("#end-reg-form").on("submit",function(e){e.preventDefault();var o=$(this).attr("action"),i=$(this).serialize();$.post(o,i,t)})}),e.init=function(e){$.extend(this.opt,e)},e}(); |
||||
var EXPO=EXPO||{};EXPO.registration=EXPO.registration||{},EXPO.registration.completion?console.warn("WARNING: EXPO.registration..completion is already defined!"):EXPO.registration.completion=function(){var e={},t=function(e){var t=$("#end-reg"),o="pwf-line",i=EXPO.common.opt.activeClass,r="phone",n="label",a=EXPO.common.opt.errMessageClass;if($("."+a,t).removeClass(i),e.success)location=e.redirect;else{console.log(e);for(var s in e.errors)e.errors.hasOwnProperty(s)&&($itemWrap=$("#id_"+s).closest("."+o),$("."+a,$itemWrap).addClass(i).text(e.errors[s][0]),$itemWrap.hasClass(r)&&$("."+n,$itemWrap).hide())}},o=function(e){$("#id_country").val("159").select2({placeholder:"Ваша страна",width:e}).on("change",function(){var e=$("option:selected",this).attr("data-phone-code");""!=$.trim(e)?$("#id_code_country").select2("val",e):$("#id_code_country").select2("val","")}),$("#id_city").select2({placeholder:"Ваш город",width:e,ajax:{url:"/city/get-city/",dataType:"json",quietMillis:200,data:function(e,t,o){var o=$("#id_country").val();return{term:e,page:t,country:o}},results:function(e){var t=[];return $.each(e,function(e,o){t.push({id:o.id,text:o.label})}),{results:t}}},initSelection:function(e,t){var o=$(e).val(),i=$(e).attr("data-init-text");t({id:o,text:i})}})};e.opt={};EXPO.common;return $(function(){$("body").addClass("body-fixed"),o("100%"),$("#id_code_country").select2({width:"95px"}),$.fancybox.open([{href:"#end-reg"}],{closeBtn:!1,closeClick:!1,modal:!0,scrolling:"no",helpers:{overlay:{closeClick:!1},locked:!0},keys:{close:null}}),$("#end-reg-form").on("submit",function(e){e.preventDefault();var o=$(this).attr("action"),i=$(this).serialize();$.post(o,i,t)})}),e.init=function(e){$.extend(this.opt,e)},e}(); |
||||
@ -1 +1 @@ |
||||
var EXPO=EXPO||{};EXPO.profile=EXPO.profile||{},EXPO.profile.calendar?console.warn("WARNING: EXPO.profile.calendar is already defined!"):EXPO.profile.calendar=function(){var e=(EXPO.common,{});return e.opt={},$(function(){$("#btn_delete").on("click",function(e){e.preventDefault();var t=$("input[name=expo]:checkbox:checked").map(function(){return $(this).val()}).get(),s=$("input[name=conf]:checkbox:checked").map(function(){return $(this).val()}).get(),o=$("input[name=seminar]:checkbox:checked").map(function(){return $(this).val()}).get(),l=$("input[name=webinar]:checkbox:checked").map(function(){return $(this).val()}).get(),n={expo:JSON.stringify(t),conf:JSON.stringify(s),seminar:JSON.stringify(o),webinar:JSON.stringify(l)};$.get("/profile/calendar/remove/",n,function(e){e.success&&location.reload()})})}),e.init=function(e){$.extend(this.opt,e);var t=this,s=$("#"+this.opt.scrollBoxId),o=$("#"+this.opt.calenadrId),l=(o.find("td."+this.opt.currentDayClass).index()*this.opt.cellWidth,$("#"+this.opt.scrollLeftId)),n=$("#"+this.opt.scrollRightId),c=$("."+this.opt.noEventsClass),i=$("."+this.opt.calendarToggleClass),r=this.opt.cellWidth*this.opt.cellsToScroll,a=0,f=function(){var e,s,o=0,l=0,n=t.opt.cellWidth,c=$("#"+t.opt.calenadrId),i=c.find("td."+t.opt.currentDayClass).index(),r=t.opt.cellsToScroll,a=c.find("."+t.opt.daysClass+" td").length;return t.stepWidth=r*n,t.calendarWidth=n*a,i>0?(i++,e=a/r,s=a/i,l=e-s,t.currentDay=i,l?(l=Math.floor(l-1),o=r*l*n):o=0):(t.currentDay=0,o=0),o};this.$leftScroll=l,this.$rightScroll=n,this.currentOffset=f(),this.scrollStep=r,this.$scrollBox=s,this.$messages=[],$(function(){c.each(function(){$(this).attr("colspan")&&1!=$(this).attr("colspan")?$(this).width()>t.stepWidth&&t.$messages.push($(".message",$(this)).width(t.stepWidth).css({marginLeft:t.currentOffset+"px"})):$(this).find("."+t.opt.eventWrapClass).addClass("small")}),$("."+t.opt.eventsClass).each(function(){a++,3==a&&$(this).addClass("grey"),4==a&&($(this).addClass("grey"),a=0)})}),$(window).load(function(){s.mCustomScrollbar({axis:"y",horizontalScroll:!0,setLeft:"-"+EXPO.profile.calendar.currentOffset+"px",mouseWheel:{enable:!1},scrollButtons:{enable:!1},contentTouchScroll:!1,scrollInertia:1e3,timeout:0,advanced:{autoScrollOnFocus:!1,updateOnContentResize:!1,updateOnBrowserResize:!1},keyboard:{enable:!1},callbacks:{onScroll:function(){t.$leftScroll.off("click").one("click",function(){t.scrollLeft(t)}),t.$rightScroll.off("click").one("click",function(){t.scrollRight(t)})}}})}),l.one("click",function(){t.scrollLeft(t)}),n.one("click",function(){t.scrollRight(t)}),i.on("click",function(){var e=$(this),t=e.closest(".ep-sect"),s=t.children("div.ep-sect-body");return t.hasClass("eps-opened")?(n.hide(),l.hide(),s.stop().animate({opacity:0},300,function(){t.removeClass("eps-opened")})):(n.show(),l.show(),s.stop().animate({opacity:1},300,function(){t.addClass("eps-opened")})),!1})},e.scrollRight=function(e){return e||(e=this),e.$rightScroll.off("click"),e.currentOffset+e.stepWidth<e.calendarWidth&&(e.currentOffset+=e.scrollStep,console.log("!!! right scroll fired!"),e.$scrollBox.mCustomScrollbar("scrollTo","-="+e.scrollStep),e.offsetMessages()),!1},e.scrollLeft=function(e){return e||(e=this),e.$leftScroll.off("click"),e.currentOffset>=e.stepWidth&&(e.currentOffset-=e.scrollStep,console.log("!!! left scroll fired!"),e.$scrollBox.mCustomScrollbar("scrollTo","+="+e.scrollStep),e.offsetMessages(e)),!1},e.offsetMessages=function(e){e||(e=this);for(var t=0;t<e.$messages.length;t++){var s=parseInt(e.$messages[t].inlineStyle("margin-left"));s>=0&&(e.$messages[t].addClass("hidden"),e.$messages[t].css({marginLeft:e.currentOffset+"px"}),e.$messages[t].removeClass("hidden"))}},e}(); |
||||
var EXPO=EXPO||{};EXPO.profile=EXPO.profile||{},EXPO.profile.calendar?console.warn("WARNING: EXPO.profile.calendar is already defined!"):EXPO.profile.calendar=function(){var t=(EXPO.common,{});return t.opt={},$(function(){$("#btn_delete").on("click",function(t){t.preventDefault();var e=$("input[name=expo]:checkbox:checked").map(function(){return $(this).val()}).get(),s=$("input[name=conf]:checkbox:checked").map(function(){return $(this).val()}).get(),o=$("input[name=seminar]:checkbox:checked").map(function(){return $(this).val()}).get(),l=$("input[name=webinar]:checkbox:checked").map(function(){return $(this).val()}).get(),n={expo:JSON.stringify(e),conf:JSON.stringify(s),seminar:JSON.stringify(o),webinar:JSON.stringify(l)};$.get("/profile/calendar/remove/",n,function(t){t.success&&location.reload()})})}),t.init=function(t){$.extend(this.opt,t);var e=this,s=$("#"+this.opt.scrollBoxId),o=$("#"+this.opt.calenadrId),l=(o.find("td."+this.opt.currentDayClass).index()*this.opt.cellWidth,$("#"+this.opt.scrollLeftId)),n=$("#"+this.opt.scrollRightId),c=$("."+this.opt.noEventsClass),i=$("."+this.opt.calendarToggleClass),r=this.opt.cellWidth*this.opt.cellsToScroll,a=function(){var t,s,o=0,l=0,n=e.opt.cellWidth,c=$("#"+e.opt.calenadrId),i=c.find("."+e.opt.daysClass+" td."+e.opt.currentDayClass).index(),r=e.opt.cellsToScroll,a=c.find("."+e.opt.daysClass+" td").length;return i>0?(i++,t=a/r,s=a/i,l=t-Math.floor(s),e.currentDay=i,l?(l--,o=r*l*n):o=0):(e.currentDay=0,o=0),o};this.$leftScroll=l,this.$rightScroll=n,this.currentOffset=a(),this.scrollStep=r,this.$scrollBox=s,this.$messages=[],this.stepWidth=e.opt.cellsToScroll*e.opt.cellWidth,$(function(){c.each(function(){$(this).attr("colspan")&&1!=$(this).attr("colspan")?$(this).width()>e.stepWidth&&e.$messages.push($(".message",$(this)).width(e.stepWidth).css({marginLeft:e.currentOffset+"px"})):$(this).find("."+e.opt.eventWrapClass).addClass("small")}),$("."+e.opt.eventsClass+":even").addClass("grey")}),$(window).load(function(){e.calendarWidth=e.opt.cellWidth*o.find("."+e.opt.daysClass+" td").length,s.mCustomScrollbar({axis:"y",horizontalScroll:!0,setLeft:"-"+e.currentOffset+"px",mouseWheel:{enable:!1},scrollButtons:{enable:!1},contentTouchScroll:!1,scrollInertia:1e3,timeout:0,advanced:{autoScrollOnFocus:!1,updateOnContentResize:!1,updateOnBrowserResize:!1},keyboard:{enable:!1},callbacks:{onScroll:function(){e.$leftScroll.off("click").one("click",function(){e.scrollLeft(e)}),e.$rightScroll.off("click").one("click",function(){e.scrollRight(e)})}}}),l.one("click",function(){e.scrollLeft(e)}),n.one("click",function(){e.scrollRight(e)})}),i.on("click",function(){var t=$(this),e=t.closest(".ep-sect"),s=e.children("div.ep-sect-body");return e.hasClass("eps-opened")?(n.hide(),l.hide(),s.stop().animate({opacity:0},300,function(){e.removeClass("eps-opened")})):(n.show(),l.show(),s.stop().animate({opacity:1},300,function(){e.addClass("eps-opened")})),!1})},t.scrollRight=function(t){return t||(t=this),t.currentOffset+t.stepWidth<t.calendarWidth&&(t.currentOffset+=t.scrollStep,console.log("!!! right scroll fired!"),t.$scrollBox.mCustomScrollbar("scrollTo","-="+t.scrollStep),t.offsetMessages()),!1},t.scrollLeft=function(t){return t||(t=this),t.currentOffset>=t.stepWidth&&(t.currentOffset-=t.scrollStep,console.log("!!! left scroll fired!"),t.$scrollBox.mCustomScrollbar("scrollTo","+="+t.scrollStep),t.offsetMessages(t)),!1},t.offsetMessages=function(t){t||(t=this);for(var e=0;e<t.$messages.length;e++){var s=t.$messages[e].parent().width(),o=parseInt(t.$messages[e].parent().offset().left,10);o?o-=312:o+=312,s>t.stepWidth&&0>o&&t.$messages[e].css({marginLeft:Math.abs(o+t.stepWidth)+"px"})}},t}(); |
||||
Loading…
Reference in new issue